feat: gate the language world behind number verification
This commit is contained in:
parent
4006f3454c
commit
f8c8db4d48
39 changed files with 1445 additions and 129 deletions
|
|
@ -0,0 +1,26 @@
|
|||
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('channel surface gives every visible entry its own layout slot', () => {
|
||||
const source = read('src/main.tsx')
|
||||
const styles = read('src/styles.css')
|
||||
|
||||
const channel = source.match(/\{worldStage === 'channel'[\s\S]*?\n \{worldStage === 'enterpriseWork'/)?.[0]
|
||||
assert.ok(channel, 'channel world source must remain discoverable')
|
||||
assert.match(channel, /className="channel-primary"/)
|
||||
assert.match(channel, /className="channel-marketplace"/)
|
||||
assert.equal((channel.match(/className="channel-main"/g) || []).length, 0)
|
||||
|
||||
assert.match(styles, /\.channel-primary\s*\{/)
|
||||
assert.match(styles, /\.channel-marketplace\s*\{/)
|
||||
})
|
||||
test('the domain stage has exactly one atmosphere owner', () => {
|
||||
const source = read('src/main.tsx')
|
||||
assert.match(
|
||||
source,
|
||||
/\{!\(worldStage === 'domain' && surface === 'world'\) && <LakeAtmosphere awake=\{motionAwake\}\/>\}/,
|
||||
)
|
||||
})
|
||||
Loading…
Reference in a new issue