Fix dashboard vitest suite and run it in CI - #1160
Open
MaxGhenis wants to merge 1 commit into
Open
Conversation
The dashboard test files imported ../Documentation and ../LandingPage, components that were renamed to DocumentationContent and LandingContent (imported by the app router pages), so the suite failed on module resolution. It also never ran anywhere: no vitest config existed (so jsdom and the jest-dom setup file were not wired) and CI had no dashboard job. - Rename the test files to match the components and fix their imports. - Update stale assertions: the .doc-intro-blurb class is gone (assert the intro text directly), section tabs are asserted by button role (Installation & Usage, All Runners & CLI, Variable Mappings, Sample Datasets), and "Command-Line Interface" is now sentence-cased. Presence-style assertions keep the suite green when new tabs land (e.g. Maintenance & Roadmap in #1153). - Add coverage for the Sample Datasets links and the async-loaded Variable Mappings search box. - Add dashboard/vitest.config.mjs: jsdom environment, jest-dom setup, automatic JSX runtime, and the @ alias from jsconfig.json. - Register testing-library cleanup in src/test/setup.js: vitest runs with globals off, so RTL auto-cleanup never registers and rendered containers would otherwise leak across tests. - Add a dashboard-test CI job (bun install --frozen-lockfile + bun run test) so the suite actually gates PRs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Problem
The dashboard vitest suite was silently broken and never ran:
dashboard/src/components/__tests__/Documentation.test.jsximported../DocumentationandLandingPage.test.jsximported../LandingPage— both components were renamed (DocumentationContent.jsx,LandingContent.jsx), so both suites failed on module resolution..github/workflows/ci.ymlhad no dashboard job (only ruff, pytest, and the changelog check), so the breakage sat dormant.Changes
DocumentationContent.test.jsx,LandingContent.test.jsx) and fix the imports..doc-intro-blurbclass no longer exists (assert the intro text directly); section tabs asserted by button role — Installation & Usage, All Runners & CLI, Variable Mappings, Sample Datasets; "Command-Line Interface" is now sentence-cased ("Command-line interface"). Assertions are presence-style, so they stay green when new tabs land (verified concretely against Add Future Plans & Maintenance docs and public API contract test #1153's diff — see below).dashboard/vitest.config.mjs: jsdom environment, setup file, automatic JSX runtime,@alias matchingjsconfig.json.src/test/setup.js: vitest runs with globals off, so RTL auto-cleanup never registers; without it, rendered containers leak across tests and interaction tests click stale component instances.dashboard-testCI job:oven-sh/setup-bun@v2,bun install --frozen-lockfile,bun run testindashboard/. Theversioning/publishneeds-chain is untouched (the dashboard suite doesn't gate the Python package release).Note on #1153
#1153 (still open) adds a fifth Maintenance & Roadmap tab to
DocumentationContent.jsx. A reviewer agent applied that PR's diff on top of this branch and re-ran the suite: all tests stay green, and there is no textual conflict (this PR doesn't touchDocumentationContent.jsx). Once both merge, #1153 can extend the section-tab test with the fifth label.Verification
cd dashboard && bun run test: 2 files, 16 tests, all passing.ruff format --check .clean; no Python touched.🤖 Generated with Claude Code