Checkpoint web parity through Chromium input tasks
This commit is contained in:
13
web/tests/e2e/script-signature-negative.spec.ts
Normal file
13
web/tests/e2e/script-signature-negative.spec.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("M13-02F blocks signer replay, expiry and key confusion cases", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
const result = await page.evaluate(() => new Promise<Record<string, any>>((resolve, reject) => {
|
||||
const worker = new Worker("/src/workers/script-signature-negative-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({});
|
||||
}));
|
||||
for (const key of ["missing", "expired", "notYetValid", "publisherMismatch"]) expect(result[key]).toMatchObject({ status: "BLOCKED", code: "SCRIPT_POLICY_DENIED" });
|
||||
expect(result.swapped).toMatchObject({ status: "BLOCKED", code: "SCRIPT_SIGNATURE_INVALID" });
|
||||
});
|
||||
Reference in New Issue
Block a user