2
0

(logic) Add execute in parent window context for code block

This commit is contained in:
Baptiste Arnaud
2022-11-09 15:08:42 +01:00
parent de0158be24
commit b31b603cc7
18 changed files with 91 additions and 56 deletions

View File

@ -88,26 +88,6 @@ describe('createIframe', () => {
expect(v).toBe('varValue')
})
it('should notify when video played', async () => {
expect.assertions(1)
let hit = false
createIframe({
url: 'https://typebot.io/typebot-id',
onVideoPlayed: () => {
hit = true
},
})
window.postMessage(
{
from: 'typebot',
videoPlayed: true,
},
'*'
)
await new Promise((r) => setTimeout(r, 1))
expect(hit).toBe(true)
})
it("shouldn't execute callbacks if event from other than typebot", async () => {
expect.assertions(3)
let n, v