Public: anyone can read this; the crew can change it.
The crew hand-overs terminal tests each get their own engine, so they pass in any order #17573
Merged 3d 20h ago, live in production
fix/crewhandover-order → main 0 commits
1 file
changed +6
−3
test/tui-crewhandover-open.test.ts +6 −3
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /** The crew hand-overs screen opens a parked-twice issue with Enter and reads again on `r`. */ |
| 2 | import { afterAll, beforeAll, expect, test } from "bun:test"; | |
| 2 | import { afterEach, beforeEach, expect, test } from "bun:test"; | |
| 3 | 3 | import { OLD_KEYS_UNTIL, provideOldKeysClockForTest } from "../src/web/keymap.ts"; |
| 4 | 4 | import { createUser, getUserByName } from "../src/core/users.ts"; |
| 5 | 5 | import type { Ctx } from "../src/tui/app/app.ts"; |
| @@ -39,7 +39,10 @@ async function crewScreen(username: string) { | ||
| 39 | 39 | return t; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | beforeAll(async () => { | |
| 42 | // Each test its own engine (#17505): the first asserts an empty hand-over list, and the others | |
| 43 | // park issues and record a drill, so one engine shared across them read the others' rows in any | |
| 44 | // order but the written one (red under `bun test --randomize --seed 9`, 2026-12-02). | |
| 45 | beforeEach(async () => { | |
| 43 | 46 | e = await engine("forge-handover-open-"); |
| 44 | 47 | const made = await createUser(e.app.db, { |
| 45 | 48 | origin: "seed", |
| @@ -51,7 +54,7 @@ beforeAll(async () => { | ||
| 51 | 54 | }); |
| 52 | 55 | if (!made.ok) throw new Error(made.error); |
| 53 | 56 | }); |
| 54 | afterAll(() => e.close()); | |
| 57 | afterEach(() => e.close()); | |
| 55 | 58 | |
| 56 | 59 | test("Enter opens the parked issue, R reads again, a non-admin gets nothing", async () => { |
| 57 | 60 | const t = await crewScreen("alice"); |
new above
offline