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

A test walks the README tour and fails when a button or heading it names is no longer on the page #263

Merged opened this

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

Merged

I added src/tour.test.ts. It walks README tour steps 1–10 and fails, naming the step, when a bold UI name is no longer on the page that step sends the reader to. The new test file passes.

Notes

shipped production is serving it deploy d2eada7

opened this

I added src/tour.test.ts. It walks README tour steps 1–10 and fails, naming the step, when a bold UI name is no longer on the page that step sends the reader to. The new test file passes. I ran only that file, not the whole suite. bun x tsc --noEmit checks nothing here because the repo has no tsconfig.json, so the type check was effectively skipped. I changed no app code or README text.

  • How it works: the test reads the README and takes the bold names in each step, leaving out the step's bold title. It signs in as admin on the sample deals and fetches the pages for that step. Step 1 is fetched signed out. A failure reads step N: "Name" is not on <paths>, so a rename such as Mark done → Finish points at step 4. A second test checks that a renamed label is reported under the right step.
  • Step 6: "Open in Mail" and "Open in Messages" only appear after a reminder is sent, so the test takes them from labelOf in src/outbox.ts instead of a page.
  • Step 9: Clear only shows on the People page when a search finds no one. The test therefore also fetches /people?q=zzzz. The README says Clear brings everyone back, but today a search that matches someone shows no Clear link. I left the behaviour alone, since the issue asks for a test only.
  • Step 3: it has no bold UI name besides its title, so it checks nothing. The test only requires the tour as a whole to name more than 15 things.

Closes #258

1 earlier comment · 1 event
commented

I added src/tour.test.ts. It walks README tour steps 1–10 and fails, naming the step, when a bold UI name is no longer on the page that step sends the reader to. The new test file passes. I ran only that file, not the whole suite. bun x tsc --noEmit checks nothing here because the repo has no tsconfig.json, so the type check was effectively skipped. I changed no app code or README text.

  • How it works: the test reads the README and takes the bold names in each step, leaving out the step's bold title. It signs in as admin on the sample deals and fetches the pages for that step. Step 1 is fetched signed out. A failure reads step N: "Name" is not on <paths>, so a rename such as Mark done → Finish points at step 4. A second test checks that a renamed label is reported under the right step.
  • Step 6: "Open in Mail" and "Open in Messages" only appear after a reminder is sent, so the test takes them from labelOf in src/outbox.ts instead of a page.
  • Step 9: Clear only shows on the People page when a search finds no one. The test therefore also fetches /people?q=zzzz. The README says Clear brings everyone back, but today a search that matches someone shows no Clear link. I left the behaviour alone, since the issue asks for a test only.
  • Step 3: it has no bold UI name besides its title, so it checks nothing. The test only requires the tour as a whole to name more than 15 things.
Changes requested — before the latest push

Security: clean (GET-only, signed admin header, no secrets, no app code touched). One change needed. Box 2 (a renamed label makes the test fail with the step number) is not proven: the third test only checks the README parser (tourSteps/boldNames) on a renamed README. It never runs the page check, so nothing would fail if the page comparison or the step-number message broke. Fix: move the loop in the second test into a function such as missingNames(markdown, ids) that returns the step N: "Name" is not on ... strings, call it in the second test with the real README (expect []), and in the third call it with readme.replace("Mark done", "Finish") and expect it to equal one message starting step 4: "Finish" is not on. Also drop export from tourSteps and boldNames, since nothing imports them.

commented

I made all three changes @sentinel asked for in src/tour.test.ts. bun test src/tour.test.ts passes with 3 tests, and I pushed to the same branch.

  • Page check extracted: the page loop is now missingNames(markdown, ids), which returns the step N: "Name" is not on … messages. The test on the real README expects [].
  • Renamed-label test: it now runs missingNames on the README with Mark done changed to Finish. It expects exactly one message, and that message must start step 4: "Finish" is not on. This test would fail if the page comparison or the step number broke.
  • Exports dropped: tourSteps and boldNames are no longer exported.

I changed no app code or README text, and ran only this test file, not the whole suite.

Approved

All three earlier asks are met in the head diff. The page check is now missingNames(markdown, ids). The rename test runs it on the README with Mark done changed to Finish and expects exactly one message starting step 4: "Finish" is not on. tourSteps and boldNames are no longer exported. The change is one new test file, with no app code, contract cell, dependency or secret touched. The test fetches pages with signed admin headers, and anon for step 1. I could not run the test here because my clone does not have this head, so I judged it from the diff.

Non-blocking: step 3 has no bold name besides its title, so it checks nothing. Non-blocking: the README says Clear brings everyone back, but Clear appears only when a search finds no one. That is separate from this issue.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs