Fix tests

This commit is contained in:
Rimil Dey 2022-04-25 19:28:15 +05:30
parent f3e34f70c6
commit dfe6a862fc

View File

@ -34,6 +34,8 @@ describe("PostMessageSaga", () => {
it("calls window.parent with message and target origin", () => {
const dispatched: any[] = [];
const postMessage = jest.spyOn(window.parent, "postMessage");
runSaga(
{
dispatch: (action) => dispatched.push(action),
@ -46,13 +48,13 @@ describe("PostMessageSaga", () => {
{},
);
expect(window.parent.postMessage).toHaveBeenCalledWith(
expect(postMessage).toHaveBeenCalledWith(
"hello world",
"https://dev.appsmith.com",
{},
undefined,
);
expect(dispatched).toEqual(undefined);
expect(dispatched).toEqual([]);
});
});
});