Stage 7: regression tests for the polished UI (logic + behaviour)
Tests · UI / test (push) Successful in 14s
Tests · Go / test (pull_request) Successful in 6s
Tests · Integration / integration (pull_request) Successful in 11s
Tests · UI / test (pull_request) Successful in 14s

Lock the polish branch's behaviour so a future UI edit surfaces as a failing
assertion to re-agree or fix.

Unit (vitest, node env):
- placement: recallIndex, cellOccupied/isBlankSlot, non-linear direction, the
  single-tile submit default, and placementFromHint blank-fallback / rack-exhausted.
- banner: the marquee scroll-cycle repeat-then-advance, stop(), root-relative and
  multiple links.
- client.GatewayError. Extract the check-word constraints out of Game.svelte into a
  pure lib/checkword.ts (sanitize + canCheck) and cover them.

E2E (playwright mock, Chromium + WebKit):
- commit via the 🏁 control, history slide-down + close, the exchange dialog,
  check-word input sanitising + verdict, resign-to-finished, and the Settings
  board-label mode changing the on-board labels.
This commit is contained in:
Ilia Denisov
2026-06-03 17:33:47 +02:00
parent 4c475f2b0e
commit f8f7d39364
7 changed files with 267 additions and 5 deletions
+18
View File
@@ -0,0 +1,18 @@
import { describe, expect, it } from 'vitest';
import { GatewayError } from './client';
describe('GatewayError', () => {
it('carries a stable code and is a real Error', () => {
const e = new GatewayError('no_hint_available');
expect(e).toBeInstanceOf(Error);
expect(e.name).toBe('GatewayError');
expect(e.code).toBe('no_hint_available');
expect(e.message).toBe('no_hint_available'); // message defaults to the code
});
it('keeps a custom message while the code stays the i18n lookup key', () => {
const e = new GatewayError('not_your_turn', 'It is not your turn');
expect(e.code).toBe('not_your_turn');
expect(e.message).toBe('It is not your turn');
});
});