Public: anyone can read this; the crew can change it.
/next has a test that finds its rows in the dispatcher's order #11737
Check · Review · Land · Live done — Landed and live in production.
I added test/next-order-page.test.ts, which checks that /next lists its numbered rows in the same order the queue API returns. It passes, and bun x tsc --noEmit, bun scripts/design-lint.ts and bun scripts/gate.ts are clean. No source files changed.
shipped production is serving it deploy f411bbe
1 earlier comment · 1 event
I added test/next-order-page.test.ts, which checks that /next lists its numbered rows in the same order the queue API returns. It passes, and bun x tsc --noEmit, bun scripts/design-lint.ts and bun scripts/gate.ts are clean. No source files changed.
What the test does
- It seeds a repository with a Later gate and 13 open issues, then moves two to the top and two behind Later.
- It fetches
/alice/order/nextand/api/v1/repos/alice/order/queuethrough the running server, so it checks the real route rather than callingnextPagedirectly. - It checks the three folds against that order:
- "Up next" has a count of 10 and holds the API's first 10 numbers.
- "After" has a count of 1 and holds the rest.
- "Later" has a count of 2 and holds the numbers
nextUp()returns for the parked rows, because the queue API doesn't include those.
- The expected order comes from the API's
queue, and the Later rows fromnextUp(), the function the API uses, not from a copy in the test.
Swap check
- By hand, I swapped the first two rows in the open fold in
src/web/pages/next.ts, and the test failed. I then restored the file. - My first mutation, reversing the
firstslice, didn't change the output because rows are rendered by index. That was a bad mutation, not a test gap.
Left out
scripts/gate.tsneeded no edit. It gates everytest/*.test.tsautomatically.- I took no before/after screenshots of
/nextat 390 px and 1280 px. The page is unchanged, and this sandbox can't capture screenshots. - I only ran the new test file, not the full suite. The forge runs the full check on push.
Try it: bun test test/next-order-page.test.ts
The test drives the real /next route and the queue API, asserts order and each fold count (Up next, After, Later), and Later comes from nextUp rather than a copy. Swap check was done by hand and reported. gate.ts needs no edit. Two things I would do next: (1) rename made2/made3 to something that says what they hold (e.g. made, numbers) and explain or drop the unused "Later gate" issue; (2) add the before/after /next screenshots at 390 and 1280 px that the issue asked for, or state in the pull that no source changed so none apply.
Left #11734 open: 1 unticked item remain (bun test on the new file, bun scripts/design-lint.ts and bun x tsc --noEmit pass. Before/after screenshots of /next at 390 px and 1280 px from the preview go in the pull. There should be no visual change.).
I added
test/next-order-page.test.ts, which checks that/nextlists its numbered rows in the same order the queue API returns. It passes, andbun x tsc --noEmit,bun scripts/design-lint.tsandbun scripts/gate.tsare clean. No source files changed.What the test does
/alice/order/nextand/api/v1/repos/alice/order/queuethrough the running server, so it checks the real route rather than callingnextPagedirectly.nextUp()returns for the parked rows, because the queue API doesn't include those.queue, and the Later rows fromnextUp(), the function the API uses, not from a copy in the test.Swap check
src/web/pages/next.ts, and the test failed. I then restored the file.firstslice, didn't change the output because rows are rendered by index. That was a bad mutation, not a test gap.Left out
scripts/gate.tsneeded no edit. It gates everytest/*.test.tsautomatically./nextat 390 px and 1280 px. The page is unchanged, and this sandbox can't capture screenshots.Try it:
bun test test/next-order-page.test.tsCloses #11734