Files
scrabble-game/ui/e2e/smoke.spec.ts
T
Ilia Denisov 2c96c19aac Stage 7 polish: game rework + board zoom + tests (Parts D/E/F/I)
- Board: fixed-viewport transform-scale zoom (animated) with counter-scaled cqw labels, corner letters, bonus-label modes (boardlabels), contrasting grid lines
- Game: Screen shell + game tab-bar (Draw/Skip/Hint/Shuffle) via HoldConfirm popovers; MakeMove 🏁 + compact popup; rack collapses used slots; hint places tiles on board (placementFromHint) + no_hint_available toast; Scores:N replaces Hints; history slide-down (swipe/click, scroll-locked); check-word alphabet/length limit + in-memory cache + 5s throttle
- backend: no_hint_available result code split + test
- vitest: banner rotator + linkify, resultBadge, boardlabels, placementFromHint (29 tests); Playwright smoke updated; prod bundle ~74 KB gzip
2026-06-03 13:33:03 +02:00

31 lines
1.4 KiB
TypeScript

import { expect, test } from '@playwright/test';
// The playable-slice smoke against the mock transport: guest login -> lobby shows the
// seeded active game -> open it -> the board renders committed tiles -> place a rack
// tile (tap) and see the score preview.
test('guest reaches a board and previews a placement', async ({ page }) => {
await page.goto('/');
await page.getByRole('button', { name: /guest/i }).click();
await expect(page.getByText('Active games')).toBeVisible();
const activeRow = page.getByRole('button', { name: /Ann/ });
await expect(activeRow).toBeVisible();
await activeRow.click();
// Board renders, including a committed tile from the seeded HELLO play.
await expect(page.locator('[data-cell]').first()).toBeVisible();
await expect(page.locator('[data-cell] .letter', { hasText: 'H' }).first()).toBeVisible();
// Tap a rack tile, then an empty board cell -> a pending tile + score preview.
const rackTile = page.locator('.rack .tile').first();
await rackTile.click();
await page.locator('[data-cell]:not(.filled)').nth(30).click();
await expect(page.locator('[data-cell].pending')).toHaveCount(1);
// The score preview appears where the hints count used to be.
await expect(page.locator('.scores')).toContainText(/\d/);
// The contextual MakeMove control (🏁) appears once a tile is pending.
await expect(page.locator('.make')).toBeVisible();
});