diff --git a/ui/e2e/quickmatch.spec.ts b/ui/e2e/quickmatch.spec.ts index 4e3b388..9271dc2 100644 --- a/ui/e2e/quickmatch.spec.ts +++ b/ui/e2e/quickmatch.spec.ts @@ -76,3 +76,17 @@ test('quick game: a foreground resync recovers a join shed while the stream stay await expect(page.getByText('Robo')).toBeVisible(); await expect(page.getByText(/Searching for opponent/)).toHaveCount(0); }); + +// Regression: an opponent joining must not freeze the screen. The in-game live-event effect tracked +// the `view` it also writes, so opponent_joined re-invalidated itself in a tight loop (opponent_moved +// was spared only by its delta's move-count idempotency). The board must still respond afterwards. +test('quick game: the board stays interactive after the opponent joins', async ({ page }) => { + await enterOpenGame(page); + await page.evaluate(() => (window as unknown as { __mock: { joinOpponent(): void } }).__mock.joinOpponent()); + await expect(page.getByText('Robo')).toBeVisible(); + + // Place a rack tile on the centre star: a frozen screen renders no pending tile. + await page.locator('.rack .tile').first().click(); + await page.locator('[data-cell]:not(.filled)').nth(112).click(); // row 7, col 7 + await expect(page.locator('[data-cell].pending')).toHaveCount(1); +}); diff --git a/ui/src/game/Game.svelte b/ui/src/game/Game.svelte index cc7aa14..580d93a 100644 --- a/ui/src/game/Game.svelte +++ b/ui/src/game/Game.svelte @@ -1,5 +1,5 @@