1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-07 20:24:01 +00:00

[PM-5189] Working through jest tests for OverlayBackground and refining repositioning delays

This commit is contained in:
Cesar Gonzalez
2024-06-20 12:31:12 -05:00
parent ff5c02dbdd
commit 322bc23eab

View File

@@ -424,23 +424,6 @@ describe("OverlayBackground", () => {
expect(repositionInlineMenuSpy).not.toHaveBeenCalled();
});
it("blocks repositioning when the sender frame is for the focused field, but the inline menu is not visible", async () => {
sendMockExtensionMessage(
{ command: "updateFocusedFieldData", focusedFieldData },
sender,
);
tabsSendMessageSpy.mockImplementationOnce((_tab, message) => {
if (message.command === "checkIsAutofillInlineMenuButtonVisible") {
return Promise.resolve(false);
}
});
sendMockExtensionMessage({ command: "triggerAutofillOverlayReposition" }, sender);
await flushOverlayRepositionPromises();
expect(repositionInlineMenuSpy).not.toHaveBeenCalled();
});
it("blocks repositioning when the sender frame is not a parent frame of the focused field", async () => {
focusedFieldData = createFocusedFieldDataMock({ tabId });
const otherFrameSender = mock<chrome.runtime.MessageSender>({