-
-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat(metamask): Close all new network popovers (#1018)
- Loading branch information
1 parent
19f51dc
commit 182d801
Showing
6 changed files
with
36 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
wallets/metamask/src/pages/HomePage/actions/popups/closeNetworkAddedPopover.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type { Page } from '@playwright/test' | ||
import { clickLocatorIfCondition } from '../../../../utils/clickLocatorIfCondition' | ||
import Selectors from '../../selectors' | ||
|
||
// Note: The "Dismiss" button does NOTHING and the network is ALWAYS automatically switched. | ||
export async function closeNetworkAddedPopover(page: Page) { | ||
const switchNetworkButtonLocator = page.locator(Selectors.networkAddedPopover.switchToNetworkButton) | ||
|
||
// TODO: Extract & make configurable | ||
await clickLocatorIfCondition(switchNetworkButtonLocator, () => switchNetworkButtonLocator.isVisible(), 1_000) | ||
} |
10 changes: 10 additions & 0 deletions
10
wallets/metamask/src/pages/HomePage/actions/popups/closeNewNetworkInfoPopover.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import type { Page } from '@playwright/test' | ||
import { clickLocatorIfCondition } from '../../../../utils/clickLocatorIfCondition' | ||
import Selectors from '../../selectors' | ||
|
||
export async function closeNewNetworkInfoPopover(page: Page) { | ||
const gotItButtonLocator = page.locator(Selectors.newNetworkInfoPopover.gotItButton) | ||
|
||
// TODO: Extract & make configurable | ||
await clickLocatorIfCondition(gotItButtonLocator, () => gotItButtonLocator.isVisible(), 1_000) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export * from './closePopover' | ||
export * from './closeRecoveryPhraseReminder' | ||
export * from './closeNewNetworkInfoPopover' | ||
export * from './closeNetworkAddedPopover' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters