Skip to content

test(website): repair pre-existing red specs + drop Differentiator token stub#490

Merged
blove merged 2 commits into
mainfrom
claude/post-homepage-cleanup
May 20, 2026
Merged

test(website): repair pre-existing red specs + drop Differentiator token stub#490
blove merged 2 commits into
mainfrom
claude/post-homepage-cleanup

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 20, 2026

Summary

Two follow-ups from the homepage refresh PR review.

  1. Repair three pre-existing red specs (apps/website):

    • src/lib/docs.spec.ts > does not leave tracked MDX docs outside the configured docs inventory — was throwing inside walkMdxFiles.
    • src/lib/docs.spec.ts > has generated API docs for every documented package surface — was flagging all 7 libraries as missing api-docs.json files that actually exist.
    • src/components/docs/open-in-cockpit.spec.tsx — vitest load failure (0 tests).

    Root cause for the first two: const contentRoot = path.join(process.cwd(), 'apps', 'website', 'content', 'docs') doubles to apps/website/apps/website/... when vitest is invoked with apps/website/ as cwd (which is exactly how the website's test target runs). Fix is to derive the path from import.meta.url so it's cwd-invariant.

    Root cause for the third: the source component was deleted in 7134a387 (glassy redesign / docs refresh) but the spec was left behind. Removed it.

  2. Drop the @ngaf/design-tokens mock in Differentiator.spec.tsx. The Hero spec already proves the real module loads cleanly under vitest; stubbing it here was over-stubbing that would hide token-shape drift behind invented values. Tests still pass with the real module.

Test plan

  • cd apps/website && npx vitest run → 13 files passed, 55 tests passed (was 53 passed + 2 failed files + 1 zero-test load failure).

🤖 Generated with Claude Code

blove and others added 2 commits May 20, 2026 09:29
Drops the 20-line tokens stub. The Hero spec already proves the real
design-tokens module loads cleanly under vitest; stubbing it here hid
token-shape drift behind invented values.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- docs.spec.ts: contentRoot was built via path.join(process.cwd(), 'apps',
  'website', ...), which doubles to apps/website/apps/website/... when the
  runner is invoked from apps/website/. Switch to a path derived from
  import.meta.url so it's cwd-invariant. Heals both the MDX-walk crash and
  the "missing api-docs.json" false negatives (7 libraries flagged as
  missing files that actually existed).

- Delete apps/website/src/components/docs/open-in-cockpit.spec.tsx. The
  component was removed in 7134a38 (glassy redesign / docs refresh) but
  its spec was left behind, failing vitest's import resolution and
  registering as a zero-test failed suite.

Result: apps/website vitest goes from 53 passing + 2 failed test files +
1 zero-test load failure to 55 passing across 13 files.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@blove blove enabled auto-merge (squash) May 20, 2026 16:32
@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview, Comment May 20, 2026 4:35pm

Request Review

@blove blove merged commit db109a9 into main May 20, 2026
38 checks passed
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.

1 participant