test(client): add useRaffles hook tests with msw and Vitest setup (#179)#336
Open
DSOTec wants to merge 1 commit intocrackedstudio:masterfrom
Open
test(client): add useRaffles hook tests with msw and Vitest setup (#179)#336DSOTec wants to merge 1 commit intocrackedstudio:masterfrom
DSOTec wants to merge 1 commit intocrackedstudio:masterfrom
Conversation
|
Someone is attempting to deploy a commit to the otaiki1's projects Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
Please help with the authorization |
Contributor
|
Plaease resolve conflicts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds unit tests for the useRaffles hook in the frontend client, ensuring data fetching logic is tested independently of the UI.
What this PR includes
Adds useRaffles.spec.ts
Uses @testing-library/react-hooks, msw, and Vitest
Covers:
initial loading state
successful raffle data population
error handling
Adds client test setup files:
setupTests.ts
vitest.config.ts
jest.config.cjs
Updates package.json and pnpm-lock.yaml for testing dependencies and scripts
Fixes useRaffles so it safely parses filters when undefined
Testing
cd client && pnpm test
All useRaffles hook tests pass
Branch
feat/useRaffles-hook-tests
GitHub PR link
https://github.com/DSOTec/tikka/pull/new/feat/useRaffles-hook-tests
Notes
This addresses issue #179
The hook tests now validate API behavior separately from UI rendering, matching the issue goal