feat(desktop): add idle lake and Zhizhi private route
This commit is contained in:
parent
466542ac93
commit
cc802126ea
10 changed files with 385 additions and 34 deletions
|
|
@ -0,0 +1,26 @@
|
|||
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, /onPointerMove=\{wakeAmbientMotion\}/)
|
||||
assert.match(source, /onPointerDown=\{wakeAmbientMotion\}/)
|
||||
assert.match(source, /onKeyDown=\{wakeAmbientMotion\}/)
|
||||
assert.match(styles, /\.official-world \.world-star,[\s\S]*animation-play-state: paused/)
|
||||
assert.match(styles, /\.official-world\.motion-awake \.world-star,[\s\S]*animation-play-state: running/)
|
||||
})
|
||||
|
||||
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