feat(ui): reveal the full board on resign (close history, zoom out)
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 50s
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 9s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 50s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 58s
After the player confirms a resign, close the move-history drawer (portrait; the landscape dock is unaffected) and zoom the board out if it was magnified, so the resigned game shows its full final board.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user