Skip to content

feat(data): seed dataviewer frontend test foundation and per-section codecov flags#594

Merged
WilliamBerryiii merged 8 commits intomainfrom
feature/issue-210-frontend-test-foundation
May 6, 2026
Merged

feat(data): seed dataviewer frontend test foundation and per-section codecov flags#594
WilliamBerryiii merged 8 commits intomainfrom
feature/issue-210-frontend-test-foundation

Conversation

@WilliamBerryiii
Copy link
Copy Markdown
Member

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

  • Add Radix DOM shims (typed ResizeObserver / IntersectionObserver) and shared test-utils QueryClient helpers so component tests render under React 19 + Happy DOM without bespoke setup.
  • Split the Codecov vitest configuration into vitest-{components,features,lib,state,app} and wire the multi-flag upload through the workflow.
  • Drop main.tsx from the vitest-app scope and add proof tests for StarRating and ProgressOverview to validate the new harness.
  • Refresh copilot-instructions.md (L448) to document the per-section flag layout.
  • Replace fragile plain-object fetch mocks in api-client.test.ts and use-joint-config.test.ts with a jsonResponse helper that builds a fresh Response per 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.
  • Husky lint-staged ran on amend with no findings.

Related

🧪 - Generated by Copilot

@WilliamBerryiii WilliamBerryiii requested a review from a team as a code owner April 30, 2026 15:22
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.38%. Comparing base (0070b04) to head (9c28d20).

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     
Flag Coverage Δ *Carryforward flag
pester 83.13% <ø> (ø) Carriedforward from 8d407e0
pytest-data-pipeline 100.00% <ø> (ø) Carriedforward from 8d407e0
pytest-dataviewer 93.60% <ø> (ø) Carriedforward from 8d407e0
pytest-dm-tools 100.00% <ø> (ø) Carriedforward from 8d407e0
pytest-evaluation 99.51% <ø> (ø)
pytest-fuzz 4.89% <ø> (ø) Carriedforward from 8d407e0
pytest-inference 100.00% <ø> (ø) Carriedforward from 8d407e0
pytest-training 93.32% <ø> (ø) Carriedforward from 8d407e0
vitest 53.34% <ø> (+0.32%) ⬆️
vitest-app 53.34% <ø> (?)
vitest-components 53.34% <ø> (?)
vitest-features 53.34% <ø> (?)
vitest-lib 53.34% <ø> (?)
vitest-state 53.34% <ø> (?)

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
...tend/src/components/dashboard/ProgressOverview.tsx 100.00% <ø> (+71.42%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 9c28d20.
Ensure 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 Files

None

…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
@WilliamBerryiii WilliamBerryiii force-pushed the feature/issue-210-frontend-test-foundation branch from a1b7a52 to 915e6f8 Compare April 30, 2026 16:17
Copy link
Copy Markdown
Contributor

@rezatnoMsirhC rezatnoMsirhC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread codecov.yml Outdated
Bill Berry and others added 2 commits May 1, 2026 15:06
…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
Copy link
Copy Markdown
Collaborator

@katriendg katriendg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

WilliamBerryiii and others added 2 commits May 4, 2026 20:54
- 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
@WilliamBerryiii
Copy link
Copy Markdown
Member Author

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.

Resolved in latest push.

@WilliamBerryiii WilliamBerryiii merged commit c06c4e3 into main May 6, 2026
48 checks passed
@WilliamBerryiii WilliamBerryiii deleted the feature/issue-210-frontend-test-foundation branch May 6, 2026 17:05
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.

test(dataviewer): TypeScript frontend testing infrastructure and coverage — tracking issue

4 participants