diff --git a/tests/modes-api.test.ts b/tests/modes-api.test.ts index 2ac1c55..291a413 100644 --- a/tests/modes-api.test.ts +++ b/tests/modes-api.test.ts @@ -225,8 +225,9 @@ test('modes api: live matches survive a node restart (snapshot on shutdown, rest persistLive(first, dir, false); const a = first.createLobby('classic', alice); 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'); - await first.act(a.lobbyId, a.token, play); + // Random seed: the opening hand may have nothing playable on turn 1, so fall back to commit. + 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 e = await first.join(d.lobbyId, bob); const pick = (first.view(d.lobbyId, d.token) as any).draft;