feat: Challenges Page and Challenge Solve Modal 1.01

This commit is contained in:
OpenVelo Agent
2026-07-23 01:19:58 +00:00
parent ad4bda2ef9
commit 6309408f21
6 changed files with 408 additions and 109 deletions
+20
View File
@@ -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();