[PM-10155] Fixing broken jest tests for auto-submit content script (#10512)

This commit is contained in:
Cesar Gonzalez 2024-08-14 10:39:23 -05:00 committed by GitHub
parent eb868eebd7
commit 5fad072554
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 8 deletions

View File

@ -61,10 +61,13 @@ describe("AutoSubmitLogin content script", () => {
await initAutoSubmitWorkflow(); await initAutoSubmitWorkflow();
expect(chrome.runtime.sendMessage).toHaveBeenCalledWith({ expect(chrome.runtime.sendMessage).toHaveBeenCalledWith(
command: "updateIsFieldCurrentlyFilling", {
isFieldCurrentlyFilling: false, command: "updateIsFieldCurrentlyFilling",
}); isFieldCurrentlyFilling: false,
},
expect.any(Function),
);
}); });
describe("when the page contains form fields", () => { describe("when the page contains form fields", () => {
@ -78,10 +81,13 @@ describe("AutoSubmitLogin content script", () => {
}); });
await flushPromises(); await flushPromises();
expect(chrome.runtime.sendMessage).toHaveBeenCalledWith({ expect(chrome.runtime.sendMessage).toHaveBeenCalledWith(
command: "updateIsFieldCurrentlyFilling", {
isFieldCurrentlyFilling: false, command: "updateIsFieldCurrentlyFilling",
}); isFieldCurrentlyFilling: false,
},
expect.any(Function),
);
}); });
describe("triggering auto-submit on formless fields", () => { describe("triggering auto-submit on formless fields", () => {