forked from WikiDeck/wikideck
Modes: deflake restart test (opening hand may have no turn-1 play)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -225,8 +225,9 @@ test('modes api: live matches survive a node restart (snapshot on shutdown, rest
|
|||||||
persistLive(first, dir, false);
|
persistLive(first, dir, false);
|
||||||
const a = first.createLobby('classic', alice);
|
const a = first.createLobby('classic', alice);
|
||||||
const b = await first.join(a.lobbyId, bob);
|
const b = await first.join(a.lobbyId, bob);
|
||||||
const play = (first.view(a.lobbyId, a.token) as any).legalActions.find((x: any) => x.type === 'play');
|
// Random seed: the opening hand may have nothing playable on turn 1, so fall back to commit.
|
||||||
await first.act(a.lobbyId, a.token, play);
|
const legal = (first.view(a.lobbyId, a.token) as any).legalActions;
|
||||||
|
await first.act(a.lobbyId, a.token, legal.find((x: any) => x.type === 'play') ?? legal.find((x: any) => x.type === 'commit'));
|
||||||
const d = first.createLobby('draft', alice);
|
const d = first.createLobby('draft', alice);
|
||||||
const e = await first.join(d.lobbyId, bob);
|
const e = await first.join(d.lobbyId, bob);
|
||||||
const pick = (first.view(d.lobbyId, d.token) as any).draft;
|
const pick = (first.view(d.lobbyId, d.token) as any).draft;
|
||||||
|
|||||||
Reference in New Issue
Block a user