AI Implementation feature(910): Scoreboard: Ranking, Matrix, Event Log and Score Graph 1.00 (#53)

This commit was merged in pull request #53.
This commit is contained in:
2026-07-23 05:42:17 +00:00
parent 7c4843d5cc
commit 4273662211
14 changed files with 129 additions and 179 deletions
+35
View File
@@ -133,6 +133,41 @@ describe('ScoreboardStore', () => {
});
});
it('propagates challenge name and category abbreviation from SSE solve frame to the Event Log row', () => {
const api = new FakeApi();
const destroyRef: any = { onDestroy: () => {} };
const store = new ScoreboardStore(api as any, destroyRef);
void store.loadAll();
return new Promise<void>((resolve) => {
const source = makeFakeSse((type, fn) => {
if (type === 'solve') {
setTimeout(() => {
fn(new MessageEvent('solve', { data: JSON.stringify({
challenge_id: 'c2',
challenge_name: 'Hardware Hello',
category_abbreviation: 'HW',
player_id: 'p3',
player_name: 'PlayerC',
awarded_points: 115,
rank_bonus: 15,
awarded_at_utc: '2026-07-23T05:25:37.309Z',
position: 1,
}) }));
setTimeout(() => {
const top = store.eventLog()?.[0];
expect(top?.challengeName).toBe('Hardware Hello');
expect(top?.categoryAbbreviation).toBe('HW');
expect(top?.playerName).toBe('PlayerC');
expect(top?.awardedPoints).toBe(115);
resolve();
}, 0);
}, 0);
}
});
store.wireSse(() => source);
});
});
it('reset clears all signals and stops SSE', () => {
const api = new FakeApi();
const destroyRef: any = { onDestroy: () => {} };