Skip to content

Commit

Permalink
Update setupApp.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaMan123 committed Jul 19, 2023
1 parent ec4ac28 commit 5dcd615
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions e2e/setup/setupApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,19 @@ test.beforeEach(async ({ page }, { file }) => {
// used to avoid a race condition that occurs because of script loading
const trigger = page.evaluate(
() =>
new Promise((resolve) => {
window.addEventListener('fabric:setup', resolve, { once: true });
new Promise<void>((resolve) => {
window.addEventListener(
'fabric:setup',
() => {
const t = setInterval(() => {
if (window.objectMap) {
clearInterval(t);
resolve();
}
}, 100);
},
{ once: true }
);
})
);
await page.addScriptTag({
Expand Down

0 comments on commit 5dcd615

Please sign in to comment.