fix(lobby): land in the opened game on enqueue + keep open games active in the lobby
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 10s
CI / integration (pull_request) Successful in 17s
CI / ui (pull_request) Successful in 45s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 58s
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 10s
CI / integration (pull_request) Successful in 17s
CI / ui (pull_request) Successful in 45s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 58s
Review fixes for open-game auto-match: decodeMatchResult dropped the game when matched=false (an open game awaiting an opponent), so the client never navigated into it - decode the game whenever present. The lobby grouped open games (status != 'active') into 'finished'; treat 'open' as in progress in groupGames/isMyTurn and resultBadge. The under-board status bar now reads "Opponent's turn" while the empty opponent seat is to move (instead of the searching placeholder). The New Game rule toggle is shown from the start when a Russian variant is available, so selecting a variant no longer shifts the layout. Regression tests: codec (game decoded with matched=false), lobbysort + result (open is in progress), and the new-game e2e updated. UI-only; no backend or schema change.
This commit is contained in:
+7
-5
@@ -70,19 +70,21 @@ test('new game: variant buttons show a rules summary and the move-limit', async
|
||||
await expect(page.locator('.movelimit')).toBeVisible(); // turn-time under the buttons
|
||||
});
|
||||
|
||||
test('new game: auto-match selects a variant, then a Russian pick reveals the off-by-default toggle', async ({ page }) => {
|
||||
test('new game: auto-match shows the off-by-default rule toggle from the start (no layout jump on selection)', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
await page.getByRole('button', { name: /guest/i }).click();
|
||||
await page.getByRole('button', { name: /New/ }).click(); // auto-match
|
||||
// Several variants are offered, so nothing is selected: Start is disabled and there is no toggle yet.
|
||||
// Several variants are offered, so nothing is selected: Start is disabled. The rule toggle is shown
|
||||
// from the start (a Russian variant is available), so selecting one does not shift the layout.
|
||||
const start = page.getByRole('button', { name: /Start game/i });
|
||||
await expect(start).toBeDisabled();
|
||||
await expect(page.getByLabel('Multiple words per turn')).toHaveCount(0);
|
||||
// Selecting the Russian Scrabble variant highlights it, enables Start, and reveals the rule toggle (off).
|
||||
const toggle = page.getByLabel('Multiple words per turn');
|
||||
await expect(toggle).toBeVisible();
|
||||
await expect(toggle).not.toBeChecked();
|
||||
// Selecting the Russian Scrabble variant highlights it and enables Start; the toggle stays put.
|
||||
await page.locator('.variant', { hasText: 'Скрэббл' }).click();
|
||||
await expect(page.locator('.variant.selected')).toHaveCount(1);
|
||||
await expect(start).toBeEnabled();
|
||||
const toggle = page.getByLabel('Multiple words per turn');
|
||||
await expect(toggle).toBeVisible();
|
||||
await expect(toggle).not.toBeChecked();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user