20260826 两宿主全线正本/回执/状态 + 协议正本地图v1.2 + 模板/镜面/坑清单(元审计收敛commit;前人未提交改动未碰)
This commit is contained in:
parent
b95fcb57ba
commit
59fc9bfd7b
670 changed files with 133422 additions and 129 deletions
|
|
@ -0,0 +1,28 @@
|
|||
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 && <div className="world-shimmer"/)
|
||||
assert.match(source, /onPointerMove=\{wakeAmbientMotion\}/)
|
||||
assert.match(source, /onPointerDown=\{wakeAmbientMotion\}/)
|
||||
assert.match(source, /onKeyDown=\{wakeAmbientMotion\}/)
|
||||
assert.match(styles, /\.official-world \.world-star,[\s\S]*animation: none/)
|
||||
assert.match(styles, /\.official-world\.motion-awake \.world-star \{ animation: world-star-breathe/)
|
||||
})
|
||||
|
||||
test('the desktop shell has no permanent polling interval while idle', () => {
|
||||
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/)
|
||||
})
|
||||
Loading…
Reference in a new issue