Skip to content

Commit

Permalink
chore: fix Popover test (#1990)
Browse files Browse the repository at this point in the history
- openBy has no third parameter anymore
- add some delay, because even if the popover closes the test would not fail, because it is checked immediately.
  • Loading branch information
ilhan007 authored Jul 27, 2020
1 parent d6c2cbc commit 93808b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/main/test/pages/Popover.html
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
});

btnQuickViewCardOpener.addEventListener("click", function (event) {
quickViewCard.openBy(btnQuickViewCardOpener, true, false);
quickViewCard.openBy(btnQuickViewCardOpener);

btnQuickViewCardOpener.setAttribute("hidden", true);
})
Expand Down
4 changes: 4 additions & 0 deletions packages/main/test/specs/Popover.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ describe("Popover general interaction", () => {
// act - open popover and hide opener
btnOpenPopover.click();

browser.pause(500);

// assert - the popover remains open, although opener is not visible
assert.strictEqual(popover.getAttribute("open"), "true",
"Popover remains open.");
assert.strictEqual(popover.isDisplayedInViewport(), true,
"Popover remains open.");
assert.strictEqual(btnOpenPopover.isDisplayedInViewport(), false,
"Opener is not available.");

Expand Down

0 comments on commit 93808b2

Please sign in to comment.