feat: AI-game & resign UX cleanup (lobby drop, board reveal, GCG share fix, hide AI export) #80
@@ -238,6 +238,30 @@ test('dropping the game ends it and shows the result', async ({ page }) => {
|
||||
await expect(page.locator('.status .over')).toBeVisible();
|
||||
});
|
||||
|
||||
test('resigning reveals the full board: closes the history and zooms out', async ({ page }) => {
|
||||
await openGame(page);
|
||||
|
||||
// Zoom in (double-tap an empty cell), then open the history — the two states the resign
|
||||
// confirmation must clear so the resigned game shows its full board.
|
||||
await page
|
||||
.locator('[data-cell]:not(.filled)')
|
||||
.nth(20)
|
||||
.evaluate((el: HTMLElement) => {
|
||||
el.click();
|
||||
el.click();
|
||||
});
|
||||
await expect(page.locator('.viewport.zoomed')).toBeVisible();
|
||||
await page.locator('.scoreboard').click(); // open the history (the 🏁 lives in its header)
|
||||
await expect(page.locator('.boardwrap.slid')).toBeVisible();
|
||||
|
||||
await page.getByRole('button', { name: 'Drop game' }).click(); // 🏁
|
||||
await page.locator('button.danger').click(); // confirm
|
||||
|
||||
await expect(page.locator('.status .over')).toBeVisible(); // the game ended
|
||||
await expect(page.locator('.history')).toHaveCount(0); // history auto-closed (portrait)
|
||||
await expect(page.locator('.viewport.zoomed')).toHaveCount(0); // board zoomed out
|
||||
});
|
||||
|
||||
test('a placed tile drags from one board cell to another (relocation)', async ({ page }) => {
|
||||
await openGame(page);
|
||||
await page.locator('.rack .tile').first().click();
|
||||
|
||||
@@ -667,6 +667,10 @@
|
||||
busy = true;
|
||||
try {
|
||||
applyMoveResult(await gateway.resign(id));
|
||||
// Reveal the final board once the game is resigned: close the move-history drawer
|
||||
// (portrait — the landscape dock is unaffected) and zoom out if it was magnified.
|
||||
historyOpen = false;
|
||||
zoomed = false;
|
||||
} catch (e) {
|
||||
handleError(e);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user