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

The stranger's purchase is one test, and the README walks it in five minutes #17

open not picked up yet opened this
opened this

One test walks the direction's own sentence — a guest browses, keeps a cart, signs in, buys, the admin sees it appear and the money reconciles — and the README tells a person how to do the same by hand.

The suite proves the parts. Nothing yet proves the whole, which is what "done" in #7 actually says: a stranger can buy the one thing, the admin sees it appear, and the money trail is complete. This is the last issue in the map because it is the acceptance test for all of them.

Done looks like

  • [ ] src/journey.test.ts is one file telling one story, using the helpers the suite already has: anon GET / → POST /cart/add → GET /cart → GET /checkout offering Sign in → the same cookies now signed as a user the way the forge signs (#9) → POST /checkout → the mock gateway approves → /orders/:number and its receipt open for the buyer with no ?token= → /orders lists it → an admin finds it in /admin/orders and on /admin/audit.
  • [ ] The live stream is part of the walk: a subscriber opened as an admin before the purchase receives the order event (#11) naming that order number, read from the stream rather than waited for with a sleep.
  • [ ] The trail reconciles inside the test: charges less refunds equals the order's total, the stock the shop shows fell by exactly what was bought, and the order names its buyer.
  • [ ] The same walk signed out never reaches an order: POST /checkout as anon writes no order row and takes no stock.
  • [ ] It creates the product it buys rather than leaning on the seed staying as it is, runs in a couple of seconds, and adds no dependency.
  • [ ] Each step asserts with a message that names the step, so a failure says which part of the sentence broke.
  • [ ] README gains a short Try it: the handful of clicks that make a purchase against a local run, what to expect at each one, what is simulated with no Stripe keys, and the note that bun test walks the same path.
  • [ ] AGENTS.md gains one line: this is the app's acceptance test, and a change that makes it fail is a change to what the app is.

Files I expect to change

New src/journey.test.ts. Changed: README.md, AGENTS.md.

Risks

  • One long test that fails tells you little. Assert step by step, and keep the arithmetic in src/units.test.ts where it belongs — this proves the path, not the pennies.
  • An event stream left open at the end of the file hangs bun test: unsubscribe and close it.
  • It must not become a second home for behaviour. If a step needs new production code to pass, that is a bug in one of the issues before it, not work for this one.
  • Written first, it will fail until #11, #15 and #16 land. Write it last, and let it be the thing that says the map is finished.

Blocked by: #11, #15, #16.

Whose brief fits: ledger to write it; juniper to walk the README by hand on a 360px phone and say whether the five minutes are really five minutes.

Part of #7.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs