diff --git a/tests/e2e/season1-loop.spec.ts b/tests/e2e/season1-loop.spec.ts index 1a7c90f..2654500 100644 --- a/tests/e2e/season1-loop.spec.ts +++ b/tests/e2e/season1-loop.spec.ts @@ -70,6 +70,13 @@ test.describe('PIPE-07 — Season 1 full loop', () => { // Reload after clearing so the boot path sees a fresh DB. await page.goto('/?devtime=fake'); + // ASSERTION A (Plan 02-06 G1) — body background is #1a1a1a from frame + // one. The dark canvas no longer floats in a sea of white. + const bodyBg = await page.evaluate(() => { + return window.getComputedStyle(document.body).backgroundColor; + }); + expect(bodyBg).toBe('rgb(26, 26, 26)'); // #1a1a1a in computed-style form + // 2) Begin screen visible (first run). const beginButton = page.getByRole('button', { name: 'Begin' }); await expect(beginButton).toBeVisible({ timeout: 15000 }); @@ -78,6 +85,14 @@ test.describe('PIPE-07 — Season 1 full loop', () => { await beginButton.click(); await expect(beginButton).not.toBeVisible({ timeout: 5000 }); + // ASSERTION B (Plan 02-06 G2) — first-run hint is visible immediately + // after Begin dismisses (the A-Dark-Room first-prompt). Player sees + // the externalized line from ui-strings.yaml. + await expect(page.getByTestId('first-run-hint')).toBeVisible({ timeout: 5000 }); + const hintText = await page.getByTestId('first-run-hint').textContent(); + expect(hintText).toBeTruthy(); + expect(hintText!.length).toBeGreaterThan(0); + // 4) Wait for the test-exposed store + fake clock. await page.waitForFunction(() => { const w = window as unknown as DevTimeWindow; @@ -112,6 +127,11 @@ test.describe('PIPE-07 — Season 1 full loop', () => { { timeout: 5000 }, ); + // ASSERTION C (Plan 02-06 G2) — first-run hint auto-dismisses on the + // first plant. The component subscribes to the tiles slice and + // dismisses when any tile transitions to plant !== null. + await expect(page.getByTestId('first-run-hint')).not.toBeVisible({ timeout: 5000 }); + // 7) Fast-forward growth past 600 ticks (5Hz * 600 = 120s = 2min). // Advance 3 minutes wall-clock so the rosemary plant is solidly // in the 'ready' stage.