-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: sign modal not appearing when going through siwe flow (#2213)
- Loading branch information
Showing
13 changed files
with
138 additions
and
28 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
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
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
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,62 @@ | ||
import { testMEmailSiwe } from './shared/fixtures/w3m-email-fixture' | ||
import type { ModalWalletPage } from './shared/pages/ModalWalletPage' | ||
import { ModalWalletValidator } from './shared/validators/ModalWalletValidator' | ||
|
||
testMEmailSiwe.beforeEach(async ({ modalValidator }) => { | ||
const modalWaletValidator = modalValidator as ModalWalletValidator | ||
await modalWaletValidator.expectConnected() | ||
}) | ||
|
||
testMEmailSiwe('it should sign with email', async ({ modalPage, modalValidator }) => { | ||
const modalWaletValidator = modalValidator as ModalWalletValidator | ||
await modalPage.sign() | ||
await modalPage.approveSign() | ||
await modalWaletValidator.expectAcceptedSign() | ||
}) | ||
|
||
testMEmailSiwe('it should reject sign in with email', async ({ modalPage, modalValidator }) => { | ||
const modalWaletValidator = modalValidator as ModalWalletValidator | ||
await modalPage.sign() | ||
await modalPage.rejectSign() | ||
await modalWaletValidator.expectRejectedSign() | ||
}) | ||
|
||
testMEmailSiwe('it should switch network and sign', async ({ modalPage, modalValidator }) => { | ||
const modalWalletValidator = modalValidator as ModalWalletValidator | ||
const modalWalletPage = modalPage as ModalWalletPage | ||
let targetChain = 'Polygon' | ||
await modalWalletPage.openAccount() | ||
await modalWalletPage.openSettings() | ||
await modalWalletPage.switchNetwork(targetChain) | ||
await modalWalletPage.promptSiwe() | ||
await modalWalletPage.approveSign() | ||
await modalWalletValidator.expectSwitchedNetwork(targetChain) | ||
await modalWalletPage.closeModal() | ||
|
||
await modalWalletPage.sign() | ||
await modalWalletPage.approveSign() | ||
await modalWalletValidator.expectAcceptedSign() | ||
|
||
targetChain = 'Ethereum' | ||
await modalWalletPage.openAccount() | ||
await modalWalletPage.openSettings() | ||
await modalWalletPage.switchNetwork(targetChain) | ||
await modalWalletPage.promptSiwe() | ||
await modalWalletPage.approveSign() | ||
await modalWalletValidator.expectSwitchedNetwork(targetChain) | ||
await modalWalletPage.closeModal() | ||
|
||
await modalWalletPage.sign() | ||
await modalWalletPage.approveSign() | ||
await modalWalletValidator.expectAcceptedSign() | ||
}) | ||
|
||
testMEmailSiwe('it should disconnect correctly', async ({ modalPage, modalValidator }) => { | ||
const modalWaletValidator = modalValidator as ModalWalletValidator | ||
const modalWalletPage = modalPage as ModalWalletPage | ||
|
||
await modalWalletPage.openAccount() | ||
await modalWalletPage.openSettings() | ||
await modalWalletPage.disconnect() | ||
await modalWaletValidator.expectDisconnected() | ||
}) |
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
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
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
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