TEST-006: Vitest unit tests for all 9 React components (~100% coverage)#9
Draft
TEST-006: Vitest unit tests for all 9 React components (~100% coverage)#9
Conversation
…, ~100% coverage) Co-authored-by: edinc <4791281+edinc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add unit tests for React components using Vitest
TEST-006: Vitest unit tests for all 9 React components (~100% coverage)
Mar 10, 2026
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.
No test infrastructure existed for the frontend. This adds a full Vitest + Testing Library setup covering all 9 components in
src/components/.Test infrastructure
vitest,@vitest/coverage-v8,@testing-library/react,@testing-library/jest-dom,@testing-library/user-event,jsdomvite.config.ts(jsdom env, v8 coverage scoped tosrc/components/)npm test·npm run test:watch·npm run test:coveragesrc/test/setup.tsimports@testing-library/jest-dommatchersTest files (147 tests total, all passing)
PlayerCard.test.tsxTeamCard.test.tsxGameCard.test.tsxPlayerList.test.tsxTeamList.test.tsxGameList.test.tsxStatCard.test.tsxPlayerStatsGridoptional statsLayout.test.tsxNavigation.test.tsxCoverage
The single uncovered branch (
TeamList.tsx:76—team.conference \|\| 'Unknown') is dead code: teams are pre-filtered to'East'/'West'before reaching the groupBy reducer, making the fallback unreachable in practice.Original prompt
Work item: AB#1734
Created via Azure DevOps
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.