Skip to content

test(client): add useRaffles hook tests with msw and Vitest setup (#179)#336

Open
DSOTec wants to merge 1 commit intocrackedstudio:masterfrom
DSOTec:feat/useRaffles-hook-tests
Open

test(client): add useRaffles hook tests with msw and Vitest setup (#179)#336
DSOTec wants to merge 1 commit intocrackedstudio:masterfrom
DSOTec:feat/useRaffles-hook-tests

Conversation

@DSOTec
Copy link
Copy Markdown

@DSOTec DSOTec commented Mar 29, 2026

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

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

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.

@DSOTec
Copy link
Copy Markdown
Author

DSOTec commented Mar 29, 2026

Please help with the authorization

@Otaiki1
Copy link
Copy Markdown
Contributor

Otaiki1 commented Mar 30, 2026

Plaease resolve conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants