import { CodenamesGameHandler } from '../handler'; import { Clue, Team } from '../../shared/types'; describe('CodenamesGameHandler', () => { let handler: CodenamesGameHandler; beforeAll(async () => { handler = await CodenamesGameHandler.create(); await handler.joinRoom(); }, 30000); afterAll(async () => { await handler.leaveRoom(); await handler._cleanupResources(); }); it('becomes Red Spymaster', async () => { await handler.joinAsSpymaster(Team.Red); // Validate the join button is hidden (internal validation) const isButtonVisible = await handler._isJoinSpymasterButtonVisible(Team.Red); expect(isButtonVisible).toBe(false); }, 10000); it('submits a clue', async () => { const clue: Clue = { word: `TestClue${Math.floor(Math.random() * 10000)}`, count: 2 }; await handler.submitClue(clue); await handler._waitForClueInputHidden(); expect(await handler._isClueInputVisible()).toBe(false); }, 30000); });