Spaces:
Build error
Build error
Download browser/tests/handler.test.ts from Danisz/spymaster-dev-b: direct link, hf CLI and curl.
- Browser
- Download file 981 Bytes
-
https://huggingface.co/spaces/Danisz/spymaster-dev-b/resolve/main/browser/tests/handler.test.ts
- Command line
-
hf download hf://spaces/Danisz/spymaster-dev-b/browser/tests/handler.test.ts
-
curl -L -o handler.test.ts https://huggingface.co/spaces/Danisz/spymaster-dev-b/resolve/main/browser/tests/handler.test.ts
981 Bytes
| 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); | |
| }); |