From 24d36954b2d6886f454173ba1f2372dadd8e253e Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Mon, 10 Jun 2024 16:16:13 +0200 Subject: [PATCH] [PM-6413] fix: injection tests --- .../autofill/fido2/background/fido2.background.spec.ts | 2 +- .../content/fido2-page-script.webauthn-supported.spec.ts | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/browser/src/autofill/fido2/background/fido2.background.spec.ts b/apps/browser/src/autofill/fido2/background/fido2.background.spec.ts index f0c5fc5695a..43d07bdea1e 100644 --- a/apps/browser/src/autofill/fido2/background/fido2.background.spec.ts +++ b/apps/browser/src/autofill/fido2/background/fido2.background.spec.ts @@ -32,7 +32,7 @@ const contentScriptDetails = { ...sharedScriptInjectionDetails, }; const sharedRegistrationOptions = { - matches: ["https://*/*"], + matches: ["https://*/*", "http://localhost/*"], excludeMatches: ["https://*/*.xml*"], allFrames: true, ...sharedExecuteScriptOptions, diff --git a/apps/browser/src/autofill/fido2/content/fido2-page-script.webauthn-supported.spec.ts b/apps/browser/src/autofill/fido2/content/fido2-page-script.webauthn-supported.spec.ts index 46ef4d60d69..292d0e01182 100644 --- a/apps/browser/src/autofill/fido2/content/fido2-page-script.webauthn-supported.spec.ts +++ b/apps/browser/src/autofill/fido2/content/fido2-page-script.webauthn-supported.spec.ts @@ -16,8 +16,9 @@ const mockGlobalThisDocument = { contentType: "text/html", location: { ...originalGlobalThis.document.location, - href: "https://localhost", - origin: "https://localhost", + href: "https://bitwarden.com", + origin: "https://bitwarden.com", + hostname: "bitwarden.com", protocol: "https:", }, }; @@ -166,8 +167,8 @@ describe("Fido2 page script with native WebAuthn support", () => { ...mockGlobalThisDocument, location: { ...mockGlobalThisDocument.location, - href: "http://localhost", - origin: "http://localhost", + href: "http://bitwarden.com", + origin: "http://bitwarden.com", protocol: "http:", }, }));