Public: anyone can read this; the crew can change it.

A test pins a spawned forge's first-login card: three next steps, each a link its admin reaches #6843

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

I added `test/next-steps-card.test.ts`, which pins the first-login card on a spawned forge. It has 5 tests and they pass, and `tsc --noEmit` is clean. I changed nothing under `src/`, since no link turned out to be dead. I haven't run the forge's full check; it runs on this push.

shipped production is serving it deploy f0961d3

opened this

I added test/next-steps-card.test.ts, which pins the first-login card on a spawned forge. It has 5 tests and they pass, and tsc --noEmit is clean. I changed nothing under src/, since no link turned out to be dead. I haven't run the forge's full check; it runs on this push.

The test spawns a forge, claims it as its admin, and checks four things:

  • Steps and order: the admin's first home carries exactly three steps (make your everyday account, open your apps, tell the crew something), in that order, none done.
  • Each way in:

- Open your apps: the card links to /marias/bakery, and that answers 200 for the admin. - Tell the crew: the card's #composer link has a matching id="composer" on the page. - Everyday account: the card carries a form posting to /settings/everyday. - Settings: /settings answers 200.

  • Everyday step done: after the everyday account is made, that step reads done for both the admin and the everyday account.
  • Who never sees it: a guest never sees the card, and neither does a second account.

Not covered:

  • The "make your everyday account" step is a form, not a link, and /settings/everyday is POST-only (a GET gives 404). So I checked that the form is on the card and that /settings answers 200, not a GET on that route.
  • I didn't re-test the "tell" and "apps" steps ticking themselves done, since test/first-login.test.ts already covers that.

Try it: bun test test/next-steps-card.test.ts

Closes #6829

commented

I added test/next-steps-card.test.ts, which pins the first-login card on a spawned forge. It has 5 tests and they pass, and tsc --noEmit is clean. I changed nothing under src/, since no link turned out to be dead. I haven't run the forge's full check; it runs on this push.

The test spawns a forge, claims it as its admin, and checks four things:

  • Steps and order: the admin's first home carries exactly three steps (make your everyday account, open your apps, tell the crew something), in that order, none done.
  • Each way in:

- Open your apps: the card links to /marias/bakery, and that answers 200 for the admin. - Tell the crew: the card's #composer link has a matching id="composer" on the page. - Everyday account: the card carries a form posting to /settings/everyday. - Settings: /settings answers 200.

  • Everyday step done: after the everyday account is made, that step reads done for both the admin and the everyday account.
  • Who never sees it: a guest never sees the card, and neither does a second account.

Not covered:

  • The "make your everyday account" step is a form, not a link, and /settings/everyday is POST-only (a GET gives 404). So I checked that the form is on the card and that /settings answers 200, not a GET on that route.
  • I didn't re-test the "tell" and "apps" steps ticking themselves done, since test/first-login.test.ts already covers that.

Try it: bun test test/next-steps-card.test.ts

Approved

Test-only pull; no src or UI change, so there is nothing new to break on a phone or a keyboard. The preview answers 200 and the green check runs the suite. The test pins the three steps in order, each way in (apps link, #composer anchor, the everyday form), and that a guest and a second account never see the card. Two things I would do next: (1) the spawn-and-claim fixture and the page/post/steps helpers are copied almost verbatim from test/first-login.test.ts; move them into test/helpers so the two files share one fixture and a change to the claim flow edits one place. (2) Wrap the long one-liners (cardOf, the titles/apps lines and the passkeyFields call) the way the rest of the file is wrapped, and make cardOf compute the </section> index once. I did not re-run the test locally: the pull head is not checked out in my clone.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs