Upgrade dashboard to Astro 7 and add a real test suite#5
Merged
Conversation
Bump astro ^5.0.0 -> ^7.0.0. Astro 7 requires Node >=22.12.0, so raise the package engines from >=18 and the CI workflow's Node from 20 to 22. Verified against Astro 7.0.6: all 11 tests pass; full build against a real wherefore renders every page (index, log, log/[slug], questions, tags) with correct content and no deprecation warnings; dev server serves correctly; and the per-run content-store reset still works (the data-store location is unchanged in Astro 7), so the duplicate-id fix is intact. Minor bump (0.2.0) since raising the required Node engine is a breaking change for consumers on Node 18-21. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The existing tests only checked CLI exit codes and that output files exist. This adds tests that assert the dashboard actually renders correctly. - Unit tests for the pure body/topics parsers (entry-sections, topics), importing the TS sources directly via Node's native type stripping. - jsdom integration tests over a real build of the fixtures: summary-line math, active-vs-retired filtering, supersede/obsolete callouts and the replacement back-link, chips + body sections + inline-markdown rendering, question open/resolved and linked-vs-plain resolution, tag counts that exclude retired, and the client-side filter scripts (resolved tab, search, retired toggle, ?area= URL param) executed in jsdom. - Fixtures: add Q-003 (resolved, no slug, colon-space/special-char resolution as a viewer-render regression) and inline markdown in the active entry. Caught and fixed a real bug: the homepage open-questions list rendered q.data.id, which the questions schema strips, so the Q-ID showed blank; use q.id like the questions page does. Tests and fixtures stay out of the npm package (files whitelist; jsdom is a devDependency) -- verified via npm pack --dry-run (22 files, unchanged). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
From the xhigh review of this branch: - engines: raise node floor to "^22.18.0 || >=24.0.0". The old ">=22.12.0" admitted versions where the unit tests' native TS type stripping (needs >=22.18) and jsdom@^29 (needs ^22.13 || >=24, excludes 23.x) don't work. - CI: run a matrix [22.18, 24] so the declared floor and current major are both exercised, instead of one lucky "22". - tests: auto-discover via `node --test --test-concurrency=1` (rename fixture-check.mjs -> .test.mjs) so new test files aren't silently skipped, and serialize test files so render.test's build and cli.test's build can't race on the shared PACKAGE_ROOT Astro cache (the hazard the README warns of). - render.test: assert build.status === 0 in the before() hook so a failed fixture build surfaces once, not as 8 opaque ENOENTs downstream. - render.test: make the ?area= URL-param test discriminating -- give the active entry a second area (catalog) so the pre-set filter must actually exclude a row; previously every active entry was checkout, so the count assertions passed even if the filter were ignored. - tests: extract shared scaffolding (BIN, FIXTURES, runBin, uniqueTemp) into tests/helpers.mjs instead of re-deriving it under three names across files. All 30 tests pass; tarball unchanged (22 files; tests/helpers/jsdom excluded). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Upgrades
@dustinvk/wherefore-dashboardto Astro 7 (0.2.0) and replaces the shallow "does the file exist" checks with a test suite that asserts the dashboard actually renders correctly.astro^5.0.0→^7.0.0. Astro 7 requires a newer Node, so the packageenginesfloor and the CI Node version are raised accordingly. Minor bump since raising the required Node engine is breaking for consumers on older Node. The per-run content-store reset (the duplicate-id fix) still holds.?area=URL param).q.data.id(stripped by the questions schema), so the Q-ID showed blank; now usesq.idlike the questions page.^22.18.0 || >=24.0.0(so native TS type stripping and jsdom both work), run a[22.18, 24]CI matrix, auto-discover tests vianode --testwith serialized execution to avoid the shared Astro cache race, assert build status in thebefore()hook, make the?area=test actually discriminating, and extract shared scaffolding intotests/helpers.mjs.Tests and fixtures stay out of the npm package (verified via
npm pack --dry-run: 22 files, unchanged). All 30 tests pass.Test plan
node --test— all 30 tests passnpm pack --dry-runconfirms tests/helpers/jsdom excluded (22 files)🤖 Generated with Claude Code