Fix tests
This commit is contained in:
parent
f3e34f70c6
commit
dfe6a862fc
|
|
@ -34,6 +34,8 @@ describe("PostMessageSaga", () => {
|
||||||
it("calls window.parent with message and target origin", () => {
|
it("calls window.parent with message and target origin", () => {
|
||||||
const dispatched: any[] = [];
|
const dispatched: any[] = [];
|
||||||
|
|
||||||
|
const postMessage = jest.spyOn(window.parent, "postMessage");
|
||||||
|
|
||||||
runSaga(
|
runSaga(
|
||||||
{
|
{
|
||||||
dispatch: (action) => dispatched.push(action),
|
dispatch: (action) => dispatched.push(action),
|
||||||
|
|
@ -46,13 +48,13 @@ describe("PostMessageSaga", () => {
|
||||||
{},
|
{},
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(window.parent.postMessage).toHaveBeenCalledWith(
|
expect(postMessage).toHaveBeenCalledWith(
|
||||||
"hello world",
|
"hello world",
|
||||||
"https://dev.appsmith.com",
|
"https://dev.appsmith.com",
|
||||||
{},
|
undefined,
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(dispatched).toEqual(undefined);
|
expect(dispatched).toEqual([]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user