harden implementations

This commit is contained in:
seavor 2026-04-12 15:21:29 -05:00
parent c3ae4cffd6
commit 559a3ff1f4
25 changed files with 240 additions and 37 deletions

View file

@ -80,6 +80,16 @@ describe('RoomPersistence', () => {
RoomPersistence.updateGames(1, [game]);
expect(NormalizeService.normalizeGameObject).not.toHaveBeenCalled();
});
it('returns without error when gameList is empty', () => {
expect(() => RoomPersistence.updateGames(1, [])).not.toThrow();
expect(RoomsDispatch.updateGames).not.toHaveBeenCalled();
});
it('returns without error when gameList is null', () => {
expect(() => RoomPersistence.updateGames(1, null as any)).not.toThrow();
expect(RoomsDispatch.updateGames).not.toHaveBeenCalled();
});
});
it('addMessage normalizes message and dispatches', () => {