Skip to content

Commit

Permalink
🐛 fix(metamask): Use .first() in closePopover
Browse files Browse the repository at this point in the history
  • Loading branch information
duckception committed Nov 29, 2023
1 parent 19f51dc commit 08e7140
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import Selectors from '../../selectors'

// Closes the popover with news, rainbows, unicorns, and other stuff.
export async function closePopover(page: Page) {
const closeButtonLocator = page.locator(Selectors.popover.closeButton)
// We're using `first()` here just in case there are multiple popovers, which happens sometimes.
const closeButtonLocator = page.locator(Selectors.popover.closeButton).first()

// TODO: Extract & make configurable
await clickLocatorIfCondition(closeButtonLocator, () => closeButtonLocator.isVisible(), 1_000)
Expand Down

0 comments on commit 08e7140

Please sign in to comment.