mirror of
https://github.com/wassname/talk.git
synced 2026-07-07 03:11:13 +08:00
Add complex value test
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user