Skip to content

Commit

Permalink
[PM-8833] Implementing jest tests for OverlayBackground
Browse files Browse the repository at this point in the history
  • Loading branch information
cagonzalezcs committed Oct 1, 2024
1 parent 434197d commit 49a1dc4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions apps/browser/src/autofill/background/overlay.background.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ import {

import {
FocusedFieldData,
InlineMenuPosition,
PageDetailsForTab,
SubFrameOffsetData,
SubFrameOffsetsForTab,
Expand Down Expand Up @@ -2394,6 +2395,22 @@ describe("OverlayBackground", () => {
});
});

describe("getAutofillInlineMenuPosition", () => {
it("returns the current inline menu positio", async () => {
const inlineMenuPosition: InlineMenuPosition = mock<InlineMenuPosition>();
overlayBackground["inlineMenuPosition"] = inlineMenuPosition;

sendMockExtensionMessage(
{ command: "getAutofillInlineMenuPosition" },
mock<chrome.runtime.MessageSender>(),
sendResponse,
);
await flushPromises();

expect(sendResponse).toHaveBeenCalledWith(inlineMenuPosition);
});
});

describe("updateAutofillInlineMenuElementIsVisibleStatus message handler", () => {
let sender: chrome.runtime.MessageSender;
let focusedFieldData: FocusedFieldData;
Expand Down

0 comments on commit 49a1dc4

Please sign in to comment.