feat(data): seed dataviewer frontend test foundation and per-section codecov flags#594
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #594 +/- ##
==========================================
+ Coverage 77.27% 77.38% +0.11%
==========================================
Files 272 272
Lines 18140 18140
Branches 2493 2452 -41
==========================================
+ Hits 14018 14038 +20
+ Misses 3698 3677 -21
- Partials 424 425 +1
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
…codecov flags
- add Radix DOM shims (typed Observers) and test-utils QueryClient helpers
- split codecov vitest into vitest-{components,features,lib,state,app}
- multi-flag workflow upload; refresh copilot-instructions L448
- drop main.tsx from vitest-app; add StarRating/ProgressOverview proof tests
🧪 - Generated by Copilot
a1b7a52 to
915e6f8
Compare
rezatnoMsirhC
left a comment
There was a problem hiding this comment.
Thanks for the contribution — clean foundation. The DOM shims, real Response objects in fetch mocks, proof tests for StarRating and ProgressOverview, and the per-section Codecov flags are all solid. Left a couple of minor comments.
…e test helper - update codecov.yml comments to reflect actual feature directories under src/components/ - remove duplicate jsonResponse helpers from api-client.test.ts and use-joint-config.test.ts - import shared jsonResponse from @/test/test-utils 🔧 - Generated by Copilot
katriendg
left a comment
There was a problem hiding this comment.
Approving, two nit comments.
🔍 Locale-sensitive assertion fragility
File: data-management/viewer/frontend/src/components/dashboard/__tests__/ProgressOverview.test.tsx (L37)
screen.getByText('1,000') relies on .toLocaleString() producing comma-separated thousands under en-US. Happy DOM defaults to that locale today, but a CI locale drift would break this assertion silently.
Suggestion: Pin the locale in the component (toLocaleString('en-US')) or use a regex matcher in the test. Non-blocking nit.
💡 vitest-features flag scope documentation
File: codecov.yml (L230–L235)
vitest-features tracks 4 of 14 component subdirectories (dashboard/, annotation-panel/, frame-editor/, episode-viewer/). The remaining dirs are covered by the aggregate vitest-components flag so there's no gap — but a one-line comment noting these are the "most actively developed feature areas" (or whatever the intent is) would prevent future contributors from assuming something was missed.
- pin annotated/pending/total episode counts to en-US locale to prevent CI locale drift - add codecov.yml comment clarifying vitest-features flag scope intent 🔧 - Generated by Copilot
Resolved in latest push. |
Summary
Establishes the dataviewer frontend test foundation called for in #210 and splits Codecov reporting into per-section vitest flags so coverage gaps surface by area instead of being averaged into a single number.
Closes #210.
Changes
ResizeObserver/IntersectionObserver) and sharedtest-utilsQueryClienthelpers so component tests render under React 19 + Happy DOM without bespoke setup.vitest-{components,features,lib,state,app}and wire the multi-flag upload through the workflow.main.tsxfrom thevitest-appscope and add proof tests forStarRatingandProgressOverviewto validate the new harness.copilot-instructions.md(L448) to document the per-section flag layout.fetchmocks inapi-client.test.tsanduse-joint-config.test.tswith ajsonResponsehelper that builds a freshResponseper call, resolving the IV-001 single-consumption regression.Validation
npm test(frontend): full suite executed; the IV-001 surface (api-client.test.ts,use-joint-config.test.ts) plus adjacent files re-run in isolation passed 54/54 in 36.80s. Three unrelated cold-cache timeout flakes in the initial full run passed cleanly on isolated retry.lint-stagedran on amend with no findings.Related
🧪 - Generated by Copilot