Repository navigation
test(web): pin landing pricing copy to the billing plan - #5412
Conversation
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
|
Boot bundle: 608.4 KB gzip (+0.0 KB vs main) |
|
Verify follow-up, as promised in the description. CI was the gate and was green on this head ( Correcting the description on one point: I could not produce a local The three new assertions were also checked for teeth directly: with Generated by Claude Code |
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.togamebook.story.js:92, but both numbers are owned byBILLING_PLANinpackages/core/src/constants/billing.constants.ts(
DISPLAY_PRICE=amount: 799,interval: "month", andTRIAL_LENGTH_DAYS: 7). Every other user-facing pricing surface derives fromthem:
CheckoutCelebrationModal.tsx:28builds${BILLING_PLAN.TRIAL_LENGTH_DAYS}-day trial,trial-start-display.util.ts,PlanSection.tsxandTrialStartAsk.tsxread them, andstripe.service.ts:78passesTRIAL_LENGTH_DAYSas Stripe'strial_period_days, so it is the trial the account actually gets. Thehomepage 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.jsat all (
copy-static-assets.ts:73only copies it into the build), ande2e/onboarding/homepage.spec.tsmakes no price or trial assertion.Reproduced before fixing: with
TRIAL_LENGTH_DAYS: 14andamount: 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 trialand the suite stayed green. Theprice 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 thatcan 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 awindow.GAMEBOOK_STORYtemplate literal in a non-module script copied to thebuild 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.tsreads the price, interval and trial length backout 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.mdso thenext sweep does not redo it:
feat(web): pitch compass up front in the landing terminal #5410, fix(web): show pricing and trim duplicate choices on landing end screen #5411) rewriting copy, choices, CRT styling and the story graph on a
homepage that launched this week. Product and visual iteration on a new
surface, not structural debt. The pricing pin is the exception because it
is a numeric divergence, not taste.
weekViewDateString(fix(web): keep week labels on the calendar week when jumping to a date #5405). Already the owning module: it removed theinline copy in
LifeView.tsxand gaveCommandPalette.tsxthe same rule.reflection-invite.util.ts(feat(web): ask about weekly reflections after onboarding, not at sign-up #5404). Replaced the old util and storagekey outright rather than leaving a parallel copy.
reproject.ts(fix(sync): show single events outside the sync horizon #5403). Moved the horizon decision into the domainmodule, net smaller at the call site.
billing-confirmation.ts/email-layout.ts(fix(email): make cancellation confirmations personal #5399). The remainingbranches are copy that changes for different reasons.
grid-pointer-target.ts(fix(web): teach opening when clicking a day view event #5398),useGridEventEditShortcuts.ts(fix(web): let delete shortcut reach hidden events #5400). Load-bearing predicates against real pointer and hidden-event
cases.
Verify
bun knip,bun lintandbun type-checkpass.bun test:web: 816 pass,0 fail across 102 files. The
bun run verify --strictrun includingtest:a11yandtest:e2ewas still in progress when this PR was opened; thefinal
VERDICT:line is posted as a follow-up comment below.https://claude.ai/code/session_01HmwVQGZ2XS2TJbWJzFpxTT
Generated by Claude Code