diff --git a/DECISIONS.md b/DECISIONS.md index d8182c9..5f4faf7 100644 --- a/DECISIONS.md +++ b/DECISIONS.md @@ -1762,3 +1762,7 @@ Implementation decisions not spelled out in `memory-bank/implementation-plan.md` - **The welcome gate remembers a close per company id**: "Start a new company" keeps the save's id but makes a new company id, and the new company must get its own welcome. - **How to play doesn't leave Settings**: "Close" just closes it; only a new company's welcome goes to Contracts. + +## Step 22.4 + +- **"First dispatch under 30 seconds" is a new end-to-end check**, since this repo's Phase 12 had no such target. The balance simulator has no screens, so a welcome can't slow it. The new e2e test times a real start, from "Start your company" through Skip to the first tutorial run in flight, against 30 seconds. diff --git a/apps/web/e2e/22-4-first-dispatch.e2e.ts b/apps/web/e2e/22-4-first-dispatch.e2e.ts new file mode 100644 index 0000000..d5b481c --- /dev/null +++ b/apps/web/e2e/22-4-first-dispatch.e2e.ts @@ -0,0 +1,17 @@ +import { expect, test } from "@playwright/test"; +import { state } from "./support"; + +test.describe("first dispatch (CR-022 Step 22.4)", () => { + test("a new player who skips the welcome has a run in flight within 30 seconds", async ({ + page, + }) => { + await page.goto("/"); + const started = Date.now(); + await page.getByRole("button", { name: "Start your company" }).click(); + const welcome = page.getByRole("dialog", { name: "Welcome to Deadhead" }); + await welcome.getByRole("button", { name: "Skip" }).click(); + await page.getByRole("button", { name: "Fly it" }).first().click(); + await expect.poll(async () => (await state(page)).activeDispatches.length).toBe(1); + expect(Date.now() - started).toBeLessThan(30_000); + }); +}); diff --git a/memory-bank/progress.md b/memory-bank/progress.md index 8121e15..377b1a9 100644 --- a/memory-bank/progress.md +++ b/memory-bank/progress.md @@ -497,4 +497,6 @@ Spec: `memory-bank/change-requests/CR-022-welcome-screens.md` (received as "CR-0 Tests (`apps/web/test/welcome.test.tsx`): through all three cards to "Let's fly", marked seen, on Contracts with the intro card; Skip on each card does the same; no welcome after a reload; the slide class only without reduced motion; focus stays inside. `packages/engine/test/start.test.ts`: `markWelcomeSeen` records it, and it survives a reload. - [x] **Step 22.3 — Client: new company and "How to play".** "Start a new company" makes a save whose welcome is unseen, so the gate shows the cards for it. The gate's "closed" flag is now kept per company id, so a welcome closed earlier in the session doesn't hide the new company's. Settings → Help has "How to play", which opens `WelcomeCards` ending in "Close" and leaves the save alone. Tests (`apps/web/test/welcome-settings.test.tsx`): after skipping one company's welcome, a company started from Settings shows card 1 again; How to play opens anywhere, ends in Close (not "Let's fly"), stays on Settings and never calls `markWelcomeSeen`. -- [ ] Step 22.4 — Regression +- [x] **Step 22.4 — Regression.** New e2e `apps/web/e2e/22-4-first-dispatch.e2e.ts`: from "Start your company", through Skip on the welcome, to the first tutorial run in flight takes under 30 seconds. Full suite: typecheck, lint, 1414 unit tests and 10 e2e tests pass. + +**Phase 22 is complete; stopped for review.** Manual check for the user: start a new company on a phone and read through the three cards (Next, swipe, Skip), then check Settings → Help → How to play.