test(web): give the NLA stack clients an in-memory engine

The spec started two persistent WebEngineClient instances inside the
editor page, which the page's own editor excludes from the native-files
Web Lock, so the run depended on a startup race. The clients only need an
in-memory Main and now start in the same ephemeral mode the armature
coverage spec uses.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
mes123456
2026-12-02 21:17:21 +08:00
parent a42073c09e
commit a7447db9f0

View File

@@ -12,8 +12,11 @@ test("WBV2-P1112-000 preserves setNLAStack Main submission and rejects invalid a
await page.goto("/");
const result = await page.evaluate(async (input) => {
const { WebEngineClient } = await import("/src/engine-client/WebEngineClient.ts");
const client = new WebEngineClient({ timeoutMs: 60_000 });
const reopenedClient = new WebEngineClient({ timeoutMs: 60_000 });
/* The page's own editor owns the exclusive native-files Web Lock; a second
* persistent engine in the same page can never start. Only an in-memory Main
* is needed here. */
const client = new WebEngineClient({ timeoutMs: 60_000, nativeFiles: false });
const reopenedClient = new WebEngineClient({ timeoutMs: 60_000, nativeFiles: false });
const stack = (snapshot: any) => JSON.stringify(snapshot.nlaTracks ?? []);
try {
const opened = await client.openBlend(Uint8Array.from(input.bytes).buffer);