First round of test

This commit is contained in:
2026-05-24 01:07:39 +02:00
parent e2da4773bd
commit 2d898f6818
5 changed files with 94 additions and 59 deletions
+6 -6
View File
@@ -322,10 +322,10 @@ describe('DirectorsBoard', () => {
expect(controller.action).toHaveBeenCalledWith('board', 'u2', 'active', expect.any(String), expect.any(Number));
});
it('clears _undoSnapshot after use (single-step only)', () => {
it('clears _undoSnapshot after use (single-step only)', async () => {
board._undoSnapshot = new Map([['u1', 'hidden']]);
stateStore.getState.mockReturnValue('active');
board.undo();
await board.undo();
expect(board._undoSnapshot).toBeNull();
});
@@ -335,10 +335,10 @@ describe('DirectorsBoard', () => {
expect(controller.action).not.toHaveBeenCalled();
});
it('second undo is unavailable after first (no-op)', () => {
it('second undo is unavailable after first (no-op)', async () => {
board._undoSnapshot = new Map([['u1', 'hidden']]);
stateStore.getState.mockReturnValue('active');
board.undo();
await board.undo();
board.undo();
expect(controller.action).toHaveBeenCalledTimes(1);
});
@@ -430,10 +430,10 @@ describe('DirectorsBoard spotlight', () => {
expect(controller.action).toHaveBeenCalledWith('board', 'u2', 'active', expect.any(String), expect.any(Number));
});
it('clears _spotlightSnapshot after restore', () => {
it('clears _spotlightSnapshot after restore', async () => {
board._spotlightSnapshot = new Map([['u1', 'active']]);
stateStore.getState.mockReturnValue('active');
board.restoreSpotlight();
await board.restoreSpotlight();
expect(board._spotlightSnapshot).toBeNull();
});