import assert from 'node:assert/strict' import fs from 'node:fs' import test from 'node:test' const source = fs.readFileSync(new URL('../src/main.tsx', import.meta.url), 'utf8') const styles = fs.readFileSync(new URL('../src/styles.css', import.meta.url), 'utf8') test('ambient lake motion sleeps by default and wakes only after human interaction', () => { assert.match(source, /const \[motionAwake, setMotionAwake\] = useState\(false\)/) assert.match(source, /function LakeAtmosphere\(\{ awake \}: \{ awake: boolean \}\)/) assert.match(source, /\{awake &&
{ assert.doesNotMatch(source, /setInterval\s*\(/) assert.match(source, /window\.addEventListener\('focus', refreshWhenHumanReturns\)/) assert.match(source, /document\.hidden/) }) test('causal entry animations remain independent from ambient motion', () => { assert.match(styles, /\.gate-rise-star[\s\S]*animation: gate-jade-rise/) assert.doesNotMatch(styles, /\.official-world \.gate-rise-star[\s\S]*animation-play-state: paused/) })