Skip to content

Commit a7af0a0

Browse files
steipetegaoanze
andcommitted
test(browser): align snapshot regression checks with CI
Reuse the existing typed deferred helper and reduce the assertion allowance after removing the duplicate raw-ARIA cast. Co-authored-by: gaoanze <[email protected]>
1 parent 68d221c commit a7af0a0

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎config/assertion-safety-baseline.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ extensions/browser/src/browser/pw-tools-core.interactions.actions.ts 2
9292
extensions/browser/src/browser/pw-tools-core.interactions.content.ts 1
9393
extensions/browser/src/browser/pw-tools-core.interactions.execution.ts 4
9494
extensions/browser/src/browser/pw-tools-core.interactions.navigation.ts 3
95-
extensions/browser/src/browser/pw-tools-core.snapshot.ts 2
95+
extensions/browser/src/browser/pw-tools-core.snapshot.ts 1
9696
extensions/browser/src/browser/pw-tools-core.state.ts 3
9797
extensions/browser/src/browser/routes/agent.act.normalize.ts 2
9898
extensions/browser/src/browser/routes/agent.act.shared.ts 3

‎extensions/browser/src/browser/pw-tools-core.snapshot.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Browser tests cover pw tools core.snapshot plugin behavior.
2+
import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
23
import { beforeEach, describe, expect, it, vi } from "vitest";
34

45
const getPageForTargetId = vi.fn();
@@ -282,7 +283,7 @@ describe("pw-tools-core aria snapshot storage", () => {
282283

283284
it("times out a stalled selector probe without publishing late refs", async () => {
284285
const mod = await import("./pw-tools-core.snapshot.js");
285-
const pendingCount = Promise.withResolvers<number>();
286+
const pendingCount = createDeferred<number>();
286287
const ariaSnapshot = vi.fn(async () => '- button "Late"');
287288
const page = {
288289
...makeAriaSnapshotPage(ariaSnapshot),
@@ -312,7 +313,7 @@ describe("pw-tools-core aria snapshot storage", () => {
312313

313314
it("shares the capture timeout between selector lookup and snapshot", async () => {
314315
const mod = await import("./pw-tools-core.snapshot.js");
315-
const pendingCount = Promise.withResolvers<number>();
316+
const pendingCount = createDeferred<number>();
316317
const ariaSnapshot = vi.fn(async () => '- button "Present"');
317318
getPageForTargetId.mockResolvedValue({
318319
...makeAriaSnapshotPage(ariaSnapshot),

0 commit comments

Comments
 (0)