Files
workinf_Blender_Wasm/web/tests/e2e/script-sandbox-recovery.spec.ts
mes123456 380cbed4ff
Some checks are pending
M6 deployable RC / quick (push) Waiting to run
M6 deployable RC / chromium (push) Blocked by required conditions
M6 deployable RC / release (push) Blocked by required conditions
Checkpoint web parity through Chromium input tasks
2026-08-19 10:39:03 -04:00

22 lines
1.5 KiB
TypeScript

import { expect, test } from "@playwright/test";
test("M13-03G recovers a denied script in a new generation with a continuous audit chain", async ({ page }) => {
await page.goto("/");
const result = await page.evaluate(() => new Promise<Record<string, any>>((resolve, reject) => {
const worker = new Worker("/src/workers/script-sandbox-recovery-test.worker.ts", { type: "module" });
worker.onmessage = (event: MessageEvent<Record<string, any>>) => { worker.terminate(); resolve(event.data); };
worker.onerror = (event) => { worker.terminate(); reject(new Error(event.message)); };
worker.postMessage({ type: "recover" });
}));
expect(result.receipt).toMatchObject({ schemaVersion: 1, operation: "SCRIPT_SANDBOX_RECOVERY", previousGeneration: 4, nextGeneration: 5, mainRevisionBefore: 11, mainRevisionAfter: 11, recovered: true, execution: "DISABLED" });
expect(result.receipt.audit.entries).toBe(2);
expect(result.receipt.audit.first.sequence).toBe(1);
expect(result.receipt.audit.second.sequence).toBe(2);
expect(result.receipt.audit.second.previousEntrySha256).toBe(result.receipt.audit.first.entrySha256);
expect(result.receipt.audit.first.requestId).not.toBe(result.receipt.audit.second.requestId);
expect(result.receipt.audit.first.sourceSha256).toBe(result.receipt.audit.second.sourceSha256);
expect(result.receipt.audit.first.manifestSha256).toBe(result.receipt.audit.second.manifestSha256);
expect(result.replayError).toBe("SCRIPT_MANIFEST_INVALID");
expect(result.tamperError).toBe("SCRIPT_MANIFEST_INVALID");
});