AI Implementation feature(907): Challenges Page and Challenge Solve Modal 1.03 (#49)

This commit was merged in pull request #49.
This commit is contained in:
2026-07-23 03:11:18 +00:00
parent f194641e8c
commit 54f72f88dc
15 changed files with 245 additions and 73 deletions
+14 -14
View File
@@ -5,21 +5,21 @@ import {
} from '../../frontend/src/app/core/services/event-status.pure';
describe('formatDdHhMm', () => {
it('formats 90_061 seconds as 01:01:01', () => {
expect(formatDdHhMm(90_061)).toBe('01:01:01');
it('formats 90_061 seconds as 01:01:01:01', () => {
expect(formatDdHhMm(90_061)).toBe('01:01:01:01');
});
it('formats 800 seconds as 00:00:13', () => {
expect(formatDdHhMm(800)).toBe('00:00:13');
it('formats 800 seconds as 00:00:13:20', () => {
expect(formatDdHhMm(800)).toBe('00:00:13:20');
});
it('formats 0 seconds as 00:00:00', () => {
expect(formatDdHhMm(0)).toBe('00:00:00');
it('formats 0 seconds as 00:00:00:00', () => {
expect(formatDdHhMm(0)).toBe('00:00:00:00');
});
it('returns 00:00:00 for negative or non-finite values', () => {
expect(formatDdHhMm(-5)).toBe('00:00:00');
expect(formatDdHhMm(Number.NaN)).toBe('00:00:00');
it('returns 00:00:00:00 for negative or non-finite values', () => {
expect(formatDdHhMm(-5)).toBe('00:00:00:00');
expect(formatDdHhMm(Number.NaN)).toBe('00:00:00:00');
});
});
@@ -30,17 +30,17 @@ describe('deriveCountdownText', () => {
if (state === 'stopped' || state === 'unconfigured') {
expect(deriveCountdownText(state, null, null)).toBe(state === 'unconfigured' ? '' : 'Event ended');
} else {
expect(deriveCountdownText(state, null, null)).toBe('00:00:00');
expect(deriveCountdownText(state, null, null)).toBe('00:00:00:00');
}
});
});
it('returns DD:HH:mm to start when countdown and secondsToStart provided', () => {
expect(deriveCountdownText('countdown', 3600, null)).toBe('00:01:00');
it('returns DD:HH:mm:ss to start when countdown and secondsToStart provided', () => {
expect(deriveCountdownText('countdown', 3600, null)).toBe('00:01:00:00');
});
it('returns DD:HH:mm to end when running and secondsToEnd provided', () => {
expect(deriveCountdownText('running', null, 800)).toBe('00:00:13');
it('returns DD:HH:mm:ss to end when running and secondsToEnd provided', () => {
expect(deriveCountdownText('running', null, 800)).toBe('00:00:13:20');
});
it('returns "Event ended" when stopped', () => {