hololake-system-architecture/product-source/hololake-native-desktop/scripts/public-world-entrances.test.mjs

63 lines
2.9 KiB
JavaScript

import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import test from 'node:test'
const read = (path) => readFileSync(new URL(`../${path}`, import.meta.url), 'utf8')
test('number verification is an unknown star abyss and the world stays veiled until it resolves', () => {
const surface = read('src/modules/qoder-surface/StarlakeSurface.tsx')
const styles = read('src/modules/qoder-surface/starlake-surface.css')
const app = read('src/main.tsx')
assert.match(surface, /worldRevealed/)
assert.match(surface, /worldRevealing/)
assert.match(surface, /gateExpanded/)
assert.match(surface, /className=\{`star-abyss-entry/)
assert.match(surface, /className="abyss-field"/)
assert.match(surface, /className="abyss-stars"/)
assert.match(surface, /编号验证/)
assert.match(surface, /验证后展开语言世界/)
assert.doesNotMatch(surface, /lighthouse-/)
assert.doesNotMatch(surface, /光湖灯塔/)
assert.doesNotMatch(surface, /className="channel-entry"/)
assert.match(styles, /\.starlake-scene\.world-veiled \.domains/)
assert.match(styles, /\.starlake-scene\.world-veiled \.masthead/)
assert.match(styles, /\.starlake-scene \.star-abyss-entry\s*\{/)
assert.match(styles, /left:50%/)
assert.match(styles, /@keyframes sl-domain-rise/)
assert.match(styles, /@keyframes sl-abyss-open/)
assert.match(app, /className="star-abyss-dialog"/)
assert.match(app, /语言世界尚未展开/)
assert.match(app, /gateRising \|\| gateStage === 'key'/)
assert.match(app, /gateExpanded=\{gateOpen && gateStage === 'number'\}/)
})
test('main branch and zero domains are public portals with real runtime projections', () => {
const surface = read('src/modules/qoder-surface/StarlakeSurface.tsx')
const app = read('src/main.tsx')
const portal = read('src/modules/public-domain/PublicDomainPortal.tsx')
assert.match(surface, /publicAccess: true/)
assert.equal((surface.match(/publicAccess: true/g) || []).length, 3)
assert.match(app, /openPublicDomain/)
assert.match(app, /<PublicDomainPortal/)
assert.match(portal, /光湖主域/)
assert.match(portal, /光湖分域/)
assert.match(portal, /光湖零域/)
assert.match(portal, /catalogEpoch/)
assert.match(portal, /guanghuEraDay/)
assert.match(portal, /numberCoordinateCount/)
})
test('zero-sense and fifth-domain boundaries remain explicit', () => {
const app = read('src/main.tsx')
const portal = read('src/modules/public-domain/PublicDomainPortal.tsx')
const protectedFacts = app.match(/domain: 'ZERO_SENSE_DOMAIN'[\s\S]*?domain: 'FIFTH_DOMAIN'[\s\S]*?\n \] \},/)?.[0]
assert.match(app, /ZERO_SENSE_DOMAIN.*setActiveDomainInfo/s)
assert.match(app, /FIFTH_DOMAIN.*setActiveDomainInfo/s)
assert.match(portal, /前三域公共只读入口/)
assert.match(portal, /不授予安装、写入或域内管理权限/)
assert.ok(protectedFacts, 'protected domain facts must remain discoverable')
assert.doesNotMatch(protectedFacts, /TCS-GL-|PER-|ICE-GL/)
})