Commit Graph

11 Commits

Author SHA1 Message Date
41313a2477 fix: update tests to match new color palette
- Update theme.test.ts to expect primary/secondary colors instead of blue/yellow/green
- Update PrizeCard.test.tsx to expect beige-300 and primary-500 border classes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 11:27:40 +01:00
c03e6f9d12 test: add comprehensive tests for export utilities
Add tests for exportToCSV, exportToJSON, and formatDateForExport
covering file download, date formatting, and edge cases.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 22:42:05 +01:00
43a2dadd0e test: add unit tests for UI components to improve coverage
Add comprehensive tests for:
- Pagination: navigation, page numbers, disabled states
- EmptyState: message, icon, title, action button
- LoadingState: different types (page, card, table, list)
- Modal: open/close, backdrop click, escape key, sizes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 22:24:19 +01:00
79b579ae55 fix: add displayName to MockLink in UserDropdown test
Fixes ESLint react/display-name error by adding displayName
property to the MockLink component in the jest mock.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:57:51 +01:00
0dd11b572d test: add unit tests for new components to improve coverage
- Add tests for useClickOutside hook
- Add tests for UserDropdown component
- Add tests for TicketPrizeDisplay component
- Add tests for TicketTableRow component
- Increase test count from 181 to 222

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:52:04 +01:00
4962ef6848 test: add unit tests for UI components
- Add tests for PrizeCard component (8 tests, 85-100% coverage)
- Add tests for StatCard component (12 tests, 88-100% coverage)
- Add tests for StatusBadge component (19 tests, 94-97% coverage)
- Add tests for TeaIconsBackground component (7 tests, 87-100% coverage)
- Total: 50 new tests for improved code coverage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 17:26:11 +01:00
0a00c04b54 fix: reduce code duplication and add tests for SonarQube quality gate
- Consolidate API logic: hooks/useApi.ts now uses services/api.ts
- Create BaseFormField component to reduce form duplication
- Refactor FormField, FormSelect, FormTextarea to use BaseFormField
- Add centralized theme utility (utils/theme.ts) for colors/styles
- Add comprehensive tests for api, auth.service, useApi hooks, AuthContext
- Add tests for theme utility

This reduces duplication from 11.45% and improves test coverage.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 14:54:24 +01:00
b36d71abcd test: add generateId fallback tests for SSR environments
Cover all branches of generateId function:
- window.crypto (browser)
- globalThis.crypto (Node.js)
- timestamp fallback (no crypto)

helpers.ts coverage: 96.96% lines, 78.72% branches

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 14:37:07 +01:00
e488fa3299 test: add error handling tests for storage helpers
Cover localStorage error catch blocks to improve coverage.
helpers.ts coverage: 93.93% (lines)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 14:26:58 +01:00
e6769d507f fix: improve test coverage and SonarQube configuration
- Add getToken tests and improve token helper coverage
- Exclude API routes and lib from coverage analysis (infrastructure code)
- Coverage on helpers.ts: 88.88%

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 14:18:30 +01:00
a31999a037 test: add unit tests for utils/helpers.ts with 87% coverage
- Install Jest and testing dependencies
- Configure Jest with coverage reporting (lcov for SonarQube)
- Add comprehensive tests for all helper functions
- Update package.json test script to run with coverage

Test coverage:
- 42 tests passing
- 87.87% line coverage on helpers.ts
- 84.78% statement coverage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 13:50:13 +01:00