Add review tests for notices, scene prompts, and Play lock.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-21 02:46:30 +03:00
co-authored by Cursor
parent 560b48ebea
commit 1097d8ddf5
3 changed files with 98 additions and 0 deletions
@@ -292,6 +292,35 @@ describe('GameScreen view restore', () => {
expect(location.search).toContain('tab=people');
});
it('disables Play while a pausing notice is open', () => {
const screen = new GameScreen({
onLeave: () => {},
onSetRunning: () => {},
onSetSpeed: () => {},
onSkip: () => {},
});
document.body.append(screen.element);
screen.show(school({ running: false }));
const play = screen.element.querySelector<HTMLButtonElement>('.clock__controls .button--icon');
expect(play?.disabled).toBe(false);
screen.applyNotice({
type: 'notice',
id: 4,
defName: 'GenerationFailed',
severity: 2,
pause: true,
ttlMs: 0,
personId: 0,
action: 'none',
});
expect(play?.disabled).toBe(true);
expect(play?.title).toBe(t('noticePauseLocked'));
expect(screen.element.querySelector('.notice-modal')).not.toBeNull();
});
it('keeps a guest on overview even when the URL asks for manage', () => {
history.replaceState(null, '', '/?school=3&mode=manage');
const screen = new GameScreen({