Add complex value test

This commit is contained in:
Chi Vinh Le
2018-08-10 16:05:50 +02:00
parent ea02e47241
commit 9510fbed57
@@ -10,6 +10,17 @@ it("post and subscribe to a message", done => {
postMessage.send("test", "value", window);
});
it("should support complex value", done => {
const complex = { foo: "bar" };
const postMessage = new PostMessageService();
const cancel = postMessage.on("test", value => {
expect(value).toBe(complex);
done();
cancel();
});
postMessage.send("test", complex, window);
});
it("send to a different origin", done => {
const postMessage = new PostMessageService();
const cancelA = postMessage.on("testA", value => {