test: guard browser dispatcher assertions

This commit is contained in:
Peter Steinberger
2026-05-11 19:48:38 +01:00
parent 06f7adf12a
commit 60cdb99733
2 changed files with 6 additions and 2 deletions

View File

@@ -147,7 +147,9 @@ describe("pw-session getPageForTargetId", () => {
expect(fetchInit?.headers).toEqual({});
expect(fetchInit?.redirect).toBe("manual");
expect(fetchInit?.signal).toBeInstanceOf(AbortSignal);
expect(fetchInit?.dispatcher).toBeDefined();
if (fetchInit?.dispatcher === undefined) {
throw new Error("expected extension fallback fetch dispatcher");
}
} finally {
fetchSpy.mockRestore();
}

View File

@@ -309,6 +309,8 @@ describe("browser remote profile fallback and attachOnly behavior", () => {
expect(fetchInit.headers).toEqual({});
expect(fetchInit.redirect).toBe("manual");
expect(fetchInit.signal).toBeInstanceOf(AbortSignal);
expect(fetchInit.dispatcher).toBeDefined();
if (fetchInit.dispatcher === undefined) {
throw new Error("expected remote browser fetch dispatcher");
}
});
});