Add review tests for notices, scene prompts, and Play lock.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user