Skip to content

Commit

Permalink
stabilize modal test
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfranco committed Nov 13, 2024
1 parent de8ce51 commit 57fefcd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/calcite-components/src/components/modal/modal.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,9 @@ describe("calcite-modal", () => {
</div>
</calcite-modal>
`);
let openEvent = page.waitForEvent("calciteModalOpen");
await skipAnimations(page);
await page.waitForChanges();

await page.evaluate(() => {
const btn = document.getElementById("openButton");
Expand All @@ -345,10 +347,12 @@ describe("calcite-modal", () => {
modal2.open = true;
});
});
await page.waitForChanges();
await openEvent;

await page.waitForEvent("calciteModalOpen");
openEvent = page.waitForEvent("calciteModalOpen");
await page.click("#openButton");
await page.waitForEvent("calciteModalOpen");
await openEvent;

expect(await isElementFocused(page, "#modal2")).toBe(true);
});
Expand Down

0 comments on commit 57fefcd

Please sign in to comment.