test(website): give the suite an nx target and repair what rotted in the dark - #851
Merged
Conversation
…the dark
apps/website had 36 spec files and no `test` target, so nothing ever ran
them — not locally by convention, not in CI. Three files had drifted red
and nobody could have known.
Wiring:
- `test` target on apps/website (@nx/vitest:test, existing vite.config.mts)
- `npx nx test website` in the Website CI job, renamed to
'Website — lint / test / build' along with its require_scoped label so
the aggregation keeps matching
Repairs:
- PostCard: asserted the raw ISO date, but the card renders through
formatCardDate ('May 17'). Fixed by deriving from that same formatter —
a literal would rot again on 1 Jan, since the year is omitted only for
same-year posts.
- Differentiator: a row was renamed 'MIT + self-hosted' ->
'Open adapters + self-hosted'. Added a length assertion so deleting a
row from both the component and the list can't stay green.
- ThanksPage: every assertion ran against `<body><div /></body>`. It is an
async Server Component taking `searchParams: Promise<...>`, so rendering
it as sync JSX yields nothing — this never worked, it isn't drift. Now
awaits the component. Also fixed a stale link ('Installation docs' ->
'Installation & licensing', /docs/licensing) and added coverage for the
Stripe session-id guard that keeps an arbitrary query value out of the
portal URL.
Verified: 347/347 across 36 files. The nx target exits 1 on a failing test
and 0 when green (checked directly — a target that always passes would be
worse than none). Both repaired assertions mutation-tested: removing the
date from PostCard and loosening the session-id regex each fail.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
blove
enabled auto-merge (squash)
August 29, 2026 21:37
Contributor
blove
added a commit
that referenced
this pull request
Aug 29, 2026
… off inline styles (#855) * docs(plans): website suite now has an nx target and a green baseline (#851) * refactor(website): move pricing components to marketing.css CompareTable, LeadForm, CompatibilityMatrix, and PricingFAQ move their static presentation (backgrounds, borders, type scale, table cell shapes) from inline style props into src/styles/marketing.css, with zero visual change. - CompareTable's repeated cell/header style objects (shape D) collapse into a handful of `.pricing-compare-*` classes reused across tiers and rows; bounded tier/row states (highlighted tier, active billing cycle, last row) become `data-highlight`/`data-active`/`data-last` modifiers instead of inline ternaries. - LeadForm's 6 focus/blur handler pairs (border-color + box-shadow) are replaced by a single `.lead-form-input:focus` rule; the handlers are deleted. - CompatibilityMatrix's TONE_COLORS lookup becomes a `data-tone` modifier on `.compat-matrix-td-label`. - Values computed from external config (CtaStrip's `gridTemplateColumns` keyed off `TIERS.length`) stay inline per the migration's "unbounded/computed" exception. Migration: docs/superpowers/plans/2026-08-29-inline-style-substrate-migration.md * refactor(website): move blog components to marketing.css PostCard, FeaturedPostCard, BlogTagFilter, AuthorByline, and TagChips move their static presentation into src/styles/marketing.css, with zero visual change. - PostCard/FeaturedPostCard keep the existing `data-ui="card" data-hoverable` hooks (ui.css) for the resting/hover treatment from Batch 1, and layer a single component class after it in import order (marketing.css loads after ui.css) to override background/border/ padding/radius, matching the specificity precedence the inline styles previously had. - BlogTagFilter's PILL_BASE/ACTIVE/INACTIVE variant maps (shape B) become one `.blog-tag-pill` class with a `data-active` modifier; the non-link "current tag" span keeps its `cursor: default` override via a `data-static` modifier. - RecentArticles (batch 4) only consumes `<PostCard>` with no wrapping style — confirmed no double-styling. Migration: docs/superpowers/plans/2026-08-29-inline-style-substrate-migration.md * refactor(website): move contact and solutions components to marketing.css ContactForm, AltChannelRow, SlaCard, GitHubStarsPill, SolutionDemoBlock, and SolutionCodeBlock move their static presentation into src/styles/marketing.css, with zero visual change. - ContactForm has no focus/blur/invalid handling in the source (the batch brief mentions focus/validation states for the contact+pricing pair, but only LeadForm, migrated in commit 1, actually implements it) — moved as plain shape A/D, `'use client'` kept for form state. - SolutionDemoBlock/SolutionCodeBlock's `<Eyebrow style={{ color: accent, marginBottom: 12 }}>` stays inline: `accent` is a per-page prop (unbounded value), the migration's documented exception. - SolutionCodeBlock's `marginTop: index === 0 ? 0 : 24` ternary becomes a `data-first` modifier on `.sol-code-block-item`. - SolutionCodeBlock's code-frame styles merge into the `.solution-code` class the component already applied via className (unstyled until now). Migration: docs/superpowers/plans/2026-08-29-inline-style-substrate-migration.md
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.
apps/websitehas 36 spec files and notesttarget. Nothing ran them — not by local convention, not in CI. Three files had drifted red and there was no way to find out.Wiring
testtarget onapps/website(@nx/vitest:test, reusing the existingvite.config.mts)npx nx test websiteadded to the Website CI jobWebsite — lint / build→Website — lint / test / build, and itsrequire_scopedlabel updated in the same commit so the required-checks aggregation keeps matching (the name appears in two places)Repairs
PostCard asserted the raw ISO
2026-05-17, but the card renders throughformatCardDate→May 17. Fixed by deriving the expectation from that same formatter rather than hardcoding'May 17'—formatCardDateomits the year only for same-year posts, so a literal would silently rot on 1 Jan.Differentiator listed a row renamed
MIT + self-hosted→Open adapters + self-hosted. Added a length assertion, because deleting a row from both the component and the expected list would otherwise leave a shrunken table green.ThanksPage — not drift. Every assertion ran against
<body><div /></body>: it's an async Server Component takingsearchParams: Promise<...>, so rendering it as sync JSX produces nothing. This test never worked against this component shape. It now awaits the component. Also fixed a stale link (Installation docs→Installation & licensing,/docs/licensing) and added coverage for the Stripe session-id guard that keeps an arbitrary query value out of the portal URL.Verification
nx test websiteexits 1 with a deliberately broken test and 0 when green. A target that always passes would be worse than no target — which is close to the situation this PR is fixing.PostCard, and loosening the session-id regex totrue, each turn their spec red.nx lint website0 errors,nx build websitegreen.Note
apps/website/next-env.d.tsis tracked but build-generated, and flips between./.next/dev/...and../../dist/...depending on whether dev or build ran last. I reverted the churn rather than including it; it's probably a gitignore candidate, but that's outside this change.🤖 Generated with Claude Code