-
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.
:feat social login - 4- Views (#2275)
- Loading branch information
1 parent
7904ba4
commit 93c66a3
Showing
52 changed files
with
1,487 additions
and
306 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ screenshots/ | |
coverage | ||
test-results | ||
.vscode/* | ||
apps/laboratory/playwright/.auth/user.json |
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
28 changes: 28 additions & 0 deletions
28
apps/laboratory/tests/shared/fixtures/w3m-social-fixture.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,28 @@ | ||
import type { ModalFixture } from './w3m-fixture' | ||
import { ModalPage } from '../pages/ModalPage' | ||
import { ModalValidator } from '../validators/ModalValidator' | ||
import { timingFixture } from './timing-fixture' | ||
|
||
export const testMSocial = timingFixture.extend<ModalFixture>({ | ||
library: ['wagmi', { option: true }], | ||
modalPage: async ({ page, library }, use) => { | ||
const modalPage = new ModalPage(page, library, 'email') | ||
await modalPage.load() | ||
|
||
const socialMail = process.env['SOCIAL_TEST_EMAIL'] | ||
if (!socialMail) { | ||
throw new Error('SOCIAL_TEST_MAIL is not set') | ||
} | ||
const socialPass = process.env['SOCIAL_TEST_PASSWORD'] | ||
if (!socialPass) { | ||
throw new Error('SOCIAL_TEST_PASSWORD is not set') | ||
} | ||
|
||
await modalPage.loginWithSocial(socialMail, socialPass) | ||
await use(modalPage) | ||
}, | ||
modalValidator: async ({ modalPage }, use) => { | ||
const modalValidator = new ModalValidator(modalPage.page) | ||
await use(modalValidator) | ||
} | ||
}) |
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,40 @@ | ||
import { testMSocial } from './shared/fixtures/w3m-social-fixture' | ||
|
||
testMSocial.beforeEach(async ({ modalValidator }) => { | ||
await modalValidator.expectConnected() | ||
}) | ||
|
||
testMSocial('it should sign', async ({ modalPage, modalValidator }) => { | ||
await modalPage.sign() | ||
await modalPage.approveSign() | ||
await modalValidator.expectAcceptedSign() | ||
}) | ||
|
||
testMSocial('it should reject sign', async ({ modalPage, modalValidator }) => { | ||
await modalPage.sign() | ||
await modalPage.rejectSign() | ||
await modalValidator.expectRejectedSign() | ||
}) | ||
|
||
testMSocial('it should switch network and sign', async ({ modalPage, modalValidator }) => { | ||
let targetChain = 'Polygon' | ||
await modalPage.switchNetwork(targetChain) | ||
await modalValidator.expectSwitchedNetwork(targetChain) | ||
await modalPage.closeModal() | ||
await modalPage.sign() | ||
await modalPage.approveSign() | ||
await modalValidator.expectAcceptedSign() | ||
|
||
targetChain = 'Ethereum' | ||
await modalPage.switchNetwork(targetChain) | ||
await modalValidator.expectSwitchedNetwork(targetChain) | ||
await modalPage.closeModal() | ||
await modalPage.sign() | ||
await modalPage.approveSign() | ||
await modalValidator.expectAcceptedSign() | ||
}) | ||
|
||
testMSocial('it should disconnect correctly', async ({ modalPage, modalValidator }) => { | ||
await modalPage.disconnect() | ||
await modalValidator.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
Oops, something went wrong.