From 5fad0725548916b08c9cdaf10196ebea301e5889 Mon Sep 17 00:00:00 2001 From: Cesar Gonzalez Date: Wed, 14 Aug 2024 10:39:23 -0500 Subject: [PATCH] [PM-10155] Fixing broken jest tests for auto-submit content script (#10512) --- .../content/auto-submit-login.spec.ts | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/apps/browser/src/autofill/content/auto-submit-login.spec.ts b/apps/browser/src/autofill/content/auto-submit-login.spec.ts index c5bc9dbccbd..d8a192dbcab 100644 --- a/apps/browser/src/autofill/content/auto-submit-login.spec.ts +++ b/apps/browser/src/autofill/content/auto-submit-login.spec.ts @@ -61,10 +61,13 @@ describe("AutoSubmitLogin content script", () => { await initAutoSubmitWorkflow(); - expect(chrome.runtime.sendMessage).toHaveBeenCalledWith({ - command: "updateIsFieldCurrentlyFilling", - isFieldCurrentlyFilling: false, - }); + expect(chrome.runtime.sendMessage).toHaveBeenCalledWith( + { + command: "updateIsFieldCurrentlyFilling", + isFieldCurrentlyFilling: false, + }, + expect.any(Function), + ); }); describe("when the page contains form fields", () => { @@ -78,10 +81,13 @@ describe("AutoSubmitLogin content script", () => { }); await flushPromises(); - expect(chrome.runtime.sendMessage).toHaveBeenCalledWith({ - command: "updateIsFieldCurrentlyFilling", - isFieldCurrentlyFilling: false, - }); + expect(chrome.runtime.sendMessage).toHaveBeenCalledWith( + { + command: "updateIsFieldCurrentlyFilling", + isFieldCurrentlyFilling: false, + }, + expect.any(Function), + ); }); describe("triggering auto-submit on formless fields", () => {