Opt-in ?perf=1 overlay (fps, frame p50/p95, JS p50/p95, tokens, zoom; no node or ticker work when off). fff-vtt import creates and migrates a fresh/empty state dir through the shared server startup path; devbox run serve gains --image. devbox run seed creates deterministic labelled NPC tokens over the real WS (idempotent rerun, --replace), and the GM token form defaults X/Y to the viewport centre.
28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
// #82: the GM token form starts at the viewport centre, not the old 400,400. The scene is the
|
|
// seeded 4096x4096 one, so the initial 1000x700 GM view centres on 2048,2048.
|
|
import test from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import { launchBrowser, newPage, signIn, waitForVisible, withStack } from './stack.mjs'
|
|
|
|
test('GM token create defaults X/Y to the viewport centre', { timeout: 120000 }, async () => {
|
|
await withStack(async ({ origin, gmKey }) => {
|
|
const browser = await launchBrowser()
|
|
try {
|
|
const { page } = await newPage(browser)
|
|
await page.goto(`${origin}/`)
|
|
await waitForVisible(page, '#signin')
|
|
await signIn(page, gmKey)
|
|
await waitForVisible(page, '#stage canvas')
|
|
await page.waitForFunction(() => {
|
|
const x = document.querySelector('#token-x')
|
|
const y = document.querySelector('#token-y')
|
|
return x?.value === '2048' && y?.value === '2048'
|
|
}, undefined, { timeout: 20000 })
|
|
assert.equal(await page.inputValue('#token-x'), '2048')
|
|
assert.equal(await page.inputValue('#token-y'), '2048')
|
|
} finally {
|
|
await browser.close()
|
|
}
|
|
})
|
|
})
|