[app] ChairSunset: e2e watches the in-game sunset; the offline suite watches one with the server gone

This commit is contained in:
2026-11-02 07:35:31 +01:00
parent 7a6cf4c6d1
commit 8e286b2bf6
2 changed files with 36 additions and 1 deletions
+8 -1
View File
@@ -78,7 +78,8 @@ test('the shell opens from the service worker with the server gone', async ({ br
// coming back days later with no signal.
await page.close();
const again = await context.newPage();
await again.clock.setFixedTime(Date.parse('2026-03-29T12:00:00+02:00'));
// An installed clock, so the in-game sunset's half minute can be run below.
await again.clock.install({ time: Date.parse('2026-03-29T12:00:00+02:00') });
await again.goto(server.url);
await expect(again.getByRole('heading', { level: 1 })).toHaveText(PRODUCT_NAME);
await expect(again.locator('.sun p').first()).toHaveText(/in Plzeň\.$/);
@@ -86,6 +87,12 @@ test('the shell opens from the service worker with the server gone', async ({ br
await again.getByRole('button', { name: en.rose.numbers }).click();
await expect(again.locator('#rose-numbers')).toContainText(`${en.rose.daysOfCare}1`);
// Watching an in-game sunset with no network (CLAUDE.md §3, the offline suite).
await again.getByRole('button', { name: en.chair.move }).click();
await again.clock.runFor(30_000);
await expect(again.getByRole('dialog').getByText(/in Plzeň\.$/)).toBeVisible();
await again.keyboard.press('Escape');
// 3. A deep link inside the scope falls back to the shell, not an error page.
await again.goto(`${server.url}somewhere/deeper`);
await expect(again.getByRole('heading', { level: 1 })).toHaveText(PRODUCT_NAME);