Skip to content

test(web): pin landing pricing copy to the billing plan - #5412

Merged
tyler-dane merged 1 commit into
mainfrom
claude/kind-dirac-rbcbh2
Dec 1, 2026
Merged

tyler-dane merged 1 commit into
mainfrom
claude/kind-dirac-rbcbh2

Conversation

@tyler-dane

@tyler-dane tyler-dane commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

No issue: output of the scheduled tech-debt sweep.

What and why

The landing end screen advertises the price and trial length as bare
literals. #5411 added $7.99 a month after a 7-day free trial. Cancel anytime. to gamebook.story.js:92, but both numbers are owned by
BILLING_PLAN in packages/core/src/constants/billing.constants.ts
(DISPLAY_PRICE = amount: 799, interval: "month", and
TRIAL_LENGTH_DAYS: 7). Every other user-facing pricing surface derives from
them: CheckoutCelebrationModal.tsx:28 builds
${BILLING_PLAN.TRIAL_LENGTH_DAYS}-day trial, trial-start-display.util.ts,
PlanSection.tsx and TrialStartAsk.tsx read them, and
stripe.service.ts:78 passes TRIAL_LENGTH_DAYS as Stripe's
trial_period_days, so it is the trial the account actually gets. The
homepage was the only site holding its own copy of the numbers, and nothing
tied the two together.

The gap was unguarded in both directions. No test reads gamebook.story.js
at all (copy-static-assets.ts:73 only copies it into the build), and
e2e/onboarding/homepage.spec.ts makes no price or trial assertion.
Reproduced before fixing: with TRIAL_LENGTH_DAYS: 14 and amount: 999,
Checkout grants 14 days, the celebration modal says "14-day trial" and
Settings says "after 14 days", while the homepage still advertised
$7.99 a month after a 7-day free trial and the suite stayed green. The
price half is worse than a stale literal: the core comment says the amount
lives in Stripe "so operators can change the price without a deploy", and
DISPLAY_PRICE "must match the Stripe price id", so a priced surface that
can never re-read the catalog misstates terms to every prospective customer.

Closed mechanically rather than by refactor, following the 2026-11-10
CryptoKit precedent in judged-fine.md. The story is a
window.GAMEBOOK_STORY template literal in a non-module script copied to the
build verbatim, and its own header calls it "the only file a copywriter needs
to touch", so interpolating constants into it would need a new global and
would take plain prose away from the people who edit it. Instead
landing-pricing-copy.test.ts reads the price, interval and trial length back
out of the pricing line and compares them to the owning constants. It pins
values, not the sentence: the copy can be reworded freely, and only the three
numbers are fixed. All three assertions fail against drifted constants and
pass against the real ones.

Test-only and behavior preserving. No product copy, constant or runtime path
changed.

Examined and deliberately left alone, recorded in judged-fine.md so the
next sweep does not redo it:

Verify

bun knip, bun lint and bun type-check pass. bun test:web: 816 pass,
0 fail across 102 files. The bun run verify --strict run including
test:a11y and test:e2e was still in progress when this PR was opened; the
final VERDICT: line is posted as a follow-up comment below.

https://claude.ai/code/session_01HmwVQGZ2XS2TJbWJzFpxTT


Generated by Claude Code

The homepage end screen quotes "$7.99 a month after a 7-day free trial"
as literals. Both numbers are owned by BILLING_PLAN in core, and every
other user-facing site derives from them, including the celebration
modal, the trial ask, Settings, and stripe.service, which passes
TRIAL_LENGTH_DAYS as Stripe's trial_period_days. No test read the story
file, so the two could disagree silently.

Pin the values rather than the sentence: read the price, interval, and
trial length back out of the pricing line and compare them to the
constants. The story stays plain ink prose for copywriters, and the copy
can be reworded freely.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmwVQGZ2XS2TJbWJzFpxTT
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Boot bundle: 608.4 KB gzip (+0.0 KB vs main)

@tyler-dane
tyler-dane added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit f8468a2 Dec 1, 2026
23 checks passed
@tyler-dane
tyler-dane deleted the claude/kind-dirac-rbcbh2 branch December 1, 2026 11:38

Copy link
Copy Markdown
Contributor Author

Verify follow-up, as promised in the description.

CI was the gate and was green on this head (4972360): all three required
contexts passed (static, unit, e2e), with 21 successful check runs, 1
neutral (CodeQL), 1 skipped (unit-leg (backend)), and no failures. The five
e2e shards and the accessibility shard all passed there. The PR went through
the merge queue on that result.

Correcting the description on one point: I could not produce a local
bun run verify --strict VERDICT: line in this session, so there is none
to paste. This container has no compass.yaml, which AGENTS.md requires for
backend, auth, MongoDB, sync and SSE, so the backend-dependent e2e specs
cannot run here. The run reached the e2e stage and stalled against a missing
backend (PUT /user/hidden-events 500, POST /event/.../rsvp 503,
GET /contacts/suggestions 503, Failed to complete backend sign-out: warn: offline), and I stopped it rather than let a wedged run misreport. What did
complete locally, and passed: bun knip (no unused files or exports),
bun lint (every rule, including the semantic-color, barrel and locator
checks), bun type-check, and bun test:web at 816 pass / 0 fail across 102
files, which is the tier that actually covers the file this PR adds.

The three new assertions were also checked for teeth directly: with
TRIAL_LENGTH_DAYS: 14, amount: 999 and interval: "year" they all fail,
and against the real constants they all pass.


Generated by Claude Code

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.

2 participants