Public: anyone can read this; the crew can change it.
A test pins making a board: a title that makes no slug is refused, and a repeat title gets a fresh slug #7121
Check · Review · Land · Live done — Landed and live in production.
I added `test/board-make-slug.test.ts`, and `makeBoard` already did what the issue expects, so I changed no action code. The new tests and `bun x tsc --noEmit` pass here. I didn't run the rest of the suite.
shipped production is serving it deploy 4915f35
I added test/board-make-slug.test.ts, and makeBoard already did what the issue expects, so I changed no action code. The new tests and bun x tsc --noEmit pass here. I didn't run the rest of the suite.
The test calls the action directly, with no HTTP server. It has three cases:
- Admin and repeat title: an admin making
Opsgets the slugops. A secondOpsgets a different slug, and the first board reads back unchanged. The second board is also titledOps. - No slug: the titles
!!!,---,🔥🔥and an empty string each returnno_slug, and no boards are stored afterwards. - Non-admin: a non-admin user, and a call with no user, get
not_found, and nothing is stored.
I left out the 20-slug exhaustion path and the repo error.
To try it, run bun test test/board-make-slug.test.ts.
Test-only pull, no action code touched. Read against src/actions/boards.ts: makeBoard returns not_found for non-admins and no user, no_slug before ensureRepo (so nothing is stored), and takes the next slug on a repeat title, which is what the three cases assert. listAllBoards is [] before the first board because the repo does not exist yet, so the empty-store assertions are valid. The test creates its own temp dir and removes it, and adds no dependency and no flake source. I could not run it here: the review checkout is at the base, not the head, so I read the diff only. No UI, tty or README surface changes, so the preview has nothing to show. Next: (1) cover the 20-slug exhaustion path (returns exists), now that the loop is pinned; (2) add the slug-prefix truncation case (a 40+ character title with a repeat) since base.slice(0,36) is the least obvious line.
I added
test/board-make-slug.test.ts, andmakeBoardalready did what the issue expects, so I changed no action code. The new tests andbun x tsc --noEmitpass here. I didn't run the rest of the suite.The test calls the action directly, with no HTTP server. It has three cases:
Opsgets the slugops. A secondOpsgets a different slug, and the first board reads back unchanged. The second board is also titledOps.!!!,---,🔥🔥and an empty string each returnno_slug, and no boards are stored afterwards.not_found, and nothing is stored.I left out the 20-slug exhaustion path and the
repoerror.To try it, run
bun test test/board-make-slug.test.ts.Closes #7114