AI Implementation feature(905): Challenges Page and Challenge Solve Modal 1.01 (#47)
This commit was merged in pull request #47.
This commit is contained in:
@@ -183,6 +183,26 @@ describe('ChallengesPage (gate + countdown + auto-reload wiring)', () => {
|
||||
expect(handler).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
|
||||
it('repeating the same zero-countdown SSE frame does not disarm the auto-reload latch (Job 905)', () => {
|
||||
const handler = jest.fn();
|
||||
eventStore.reloadAtCountdownZero(handler);
|
||||
|
||||
const frame = {
|
||||
state: 'countdown' as const,
|
||||
serverNowUtc: new Date().toISOString(),
|
||||
eventStartUtc: new Date(Date.now() - 1000).toISOString(),
|
||||
eventEndUtc: new Date(Date.now() + 7200_000).toISOString(),
|
||||
secondsToStart: 0,
|
||||
secondsToEnd: null,
|
||||
};
|
||||
eventStore.applyServerStatus(frame);
|
||||
eventStore.applyServerStatus(frame);
|
||||
eventStore.applyServerStatus(frame);
|
||||
(eventStore as any).checkZero();
|
||||
|
||||
expect(handler).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('isRunning flips true only when state is running', async () => {
|
||||
apiSpy.getBoard.mockReturnValueOnce(of(makeBoard()));
|
||||
await challenges.load();
|
||||
|
||||
Reference in New Issue
Block a user