mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-24 21:41:33 +01:00
[PM-5189] Working through jest tests for the AutofillOverlayContentService
This commit is contained in:
parent
191797e6c2
commit
e3510a9a05
@ -1450,5 +1450,31 @@ describe("AutofillOverlayContentService", () => {
|
||||
expect(sendResponseSpy).toHaveBeenCalledWith(null);
|
||||
});
|
||||
});
|
||||
|
||||
describe("getSubFrameOffsetsFromWindowMessage", () => {
|
||||
it("sends a message to the parent to calculate the sub frame positioning", () => {
|
||||
jest.spyOn(globalThis.parent, "postMessage");
|
||||
const subFrameId = 10;
|
||||
|
||||
sendMockExtensionMessage({
|
||||
command: "getSubFrameOffsetsFromWindowMessage",
|
||||
subFrameId,
|
||||
});
|
||||
|
||||
expect(globalThis.parent.postMessage).toHaveBeenCalledWith(
|
||||
{
|
||||
command: "calculateSubFramePositioning",
|
||||
subFrameData: {
|
||||
url: window.location.href,
|
||||
frameId: subFrameId,
|
||||
left: 0,
|
||||
top: 0,
|
||||
parentFrameIds: [],
|
||||
},
|
||||
},
|
||||
"*",
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user