diff --git a/ui/e2e/game.spec.ts b/ui/e2e/game.spec.ts index 7095035..0c96883 100644 --- a/ui/e2e/game.spec.ts +++ b/ui/e2e/game.spec.ts @@ -48,6 +48,18 @@ test('a pending tile recalls on double-tap, not on a single tap', async ({ page await expect(page.locator('[data-cell].pending')).toHaveCount(0); }); +test('the board is a gapless checkerboard by default; grid lines toggle in Settings', async ({ page }) => { + await openGame(page); + await expect(page.locator('.grid.gridless')).toBeVisible(); // lines off by default + + await page.evaluate(() => (location.hash = '/settings')); + await page.locator('.gridlines input').check(); // turn grid lines on + await page.evaluate(() => (location.hash = '/game/g1')); + + await expect(page.locator('.grid')).toBeVisible(); + await expect(page.locator('.grid.gridless')).toHaveCount(0); +}); + test('shuffle reorders the rack but keeps the same tiles', async ({ page }) => { await openGame(page); const before = await page.locator('.rack .tile').allTextContents(); diff --git a/ui/src/game/Board.svelte b/ui/src/game/Board.svelte index 958accd..1a6df98 100644 --- a/ui/src/game/Board.svelte +++ b/ui/src/game/Board.svelte @@ -16,6 +16,7 @@ zoomed, variant, labelMode, + lines, locale, focus, oncell, @@ -32,6 +33,8 @@ zoomed: boolean; variant: Variant; labelMode: BoardLabelMode; + /** Draw 1px grid lines between cells; when false the board is a gapless checkerboard. */ + lines: boolean; locale: Locale; focus: { row: number; col: number } | null; oncell: (row: number, col: number) => void; @@ -94,7 +97,7 @@