forked from WikiDeck/wikideck
Upstream WikiDeck/wikideck#3 ("No homepage"). A landing block at the top of Discover explains the game in three steps, tells new players they can start with a starter deck (matches are off-chain), and its Play now button opens the Play view. App.tsx: one import and one element. Mobile-first: no hover states, a 44 px tap target, full-width button under 480 px, theme colours. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
1.1 KiB
TypeScript
17 lines
1.1 KiB
TypeScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { readFile } from 'node:fs/promises';
|
|
|
|
test('landing explains Edit War and offers a thumb-sized Play button (upstream #3)', async () => {
|
|
const read = (file: string) => readFile(new URL(`../${file}`, import.meta.url), 'utf8');
|
|
const [landing, css, app] = await Promise.all([read('src/Landing.tsx'), read('src/landing.css'), read('src/App.tsx')]);
|
|
assert.match(app, /<Landing onPlay=\{\(\) => setView\('Play'\)\} \/>/, 'App mounts the landing block and its button opens Play');
|
|
assert.match(landing, /export function Landing\(\{ onPlay/);
|
|
assert.match(landing, /onClick=\{onPlay\}/);
|
|
assert.match(landing, /Play now/);
|
|
for (const idea of ['Three Topics', 'Six turns', 'Win two Topics', 'starter deck', 'off-chain']) assert.ok(landing.includes(idea), idea);
|
|
assert.doesNotMatch(css, /:hover/, 'no hover-only interactions');
|
|
assert.match(css, /min-height:44px/, 'tap target is at least 44px');
|
|
assert.doesNotMatch(css, /#[0-9a-f]{3,6}\b/i, 'colours come from the Catppuccin theme variables');
|
|
});
|