[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
+28
View File
@@ -279,3 +279,31 @@ test.describe('keep her safe, in Prague at 08:00 on 1 March 2026', () => {
}
});
});
// --- The in-game sunset (.agents/features/chair-sunset.md) ---------------------
test.describe('the in-game sunset, in Prague at noon on 29 March 2026', () => {
test.use({ timezoneId: 'Europe/Prague', locale: 'en-US' });
test('move the chair: half a minute with nothing to press, then the real sunset\'s time; again; back', async ({ page }) => {
// An installed clock, so the scene's half minute can be run in a moment.
await page.clock.install({ time: Date.parse('2026-03-29T12:00:00+02:00') });
await open(page);
await page.getByRole('button', { name: /^Not now/ }).click();
await page.getByRole('button', { name: en.chair.move }).click();
const scene = page.getByRole('dialog', { name: en.chair.scene });
await expect(scene).toBeVisible();
await expect(scene.getByRole('button')).toHaveCount(0);
expect((await new AxeBuilder({ page }).analyze()).violations.map((v) => `${v.id}: ${v.help}`)).toEqual([]);
await page.clock.runFor(30_000);
await expect(scene.getByText(/^Tonight the sun sets at .* in Prague\.$/)).toBeVisible();
expect((await new AxeBuilder({ page }).analyze()).violations.map((v) => `${v.id}: ${v.help}`)).toEqual([]);
await scene.getByRole('button', { name: en.chair.again }).click();
await expect(scene.getByRole('button')).toHaveCount(0);
await page.keyboard.press('Escape');
await expect(scene).toHaveCount(0);
await expect(page.getByRole('button', { name: en.chair.move })).toBeFocused();
});
});