1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

[PM-8322] Firefox Inline Autofill Menu Not Propagation Correctly When Switching Tabs

This commit is contained in:
Cesar Gonzalez
2024-05-21 17:24:46 -05:00
parent 6fe095351b
commit 9dd29fc4e7

View File

@@ -971,6 +971,14 @@ describe("AutofillOverlayContentService", () => {
expect(document.body.contains(overlayButtonElement)).toEqual(false); expect(document.body.contains(overlayButtonElement)).toEqual(false);
}); });
it("sends a message to the background indicating that the overlay button has been closed", () => {
autofillOverlayContentService.removeAutofillOverlay();
expect(sendExtensionMessageSpy).toHaveBeenCalledWith("autofillOverlayElementClosed", {
overlayElement: AutofillOverlayElement.Button,
});
});
it("removes the overlay reposition event listeners", () => { it("removes the overlay reposition event listeners", () => {
jest.spyOn(globalThis.document.body, "removeEventListener"); jest.spyOn(globalThis.document.body, "removeEventListener");
jest.spyOn(globalThis, "removeEventListener"); jest.spyOn(globalThis, "removeEventListener");
@@ -1012,6 +1020,14 @@ describe("AutofillOverlayContentService", () => {
expect(autofillOverlayContentService["isOverlayListVisible"]).toEqual(false); expect(autofillOverlayContentService["isOverlayListVisible"]).toEqual(false);
expect(document.body.contains(overlayListElement)).toEqual(false); expect(document.body.contains(overlayListElement)).toEqual(false);
}); });
it("sends a message to the extension background indicating that the overlay list has closed", () => {
autofillOverlayContentService.removeAutofillOverlay();
expect(sendExtensionMessageSpy).toHaveBeenCalledWith("autofillOverlayElementClosed", {
overlayElement: AutofillOverlayElement.List,
});
});
}); });
describe("addNewVaultItem", () => { describe("addNewVaultItem", () => {