-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added QR code #23428
Merged
Merged
Added QR code #23428
Changes from all commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
6fb6df3
Added QR code
albertolive 36ec5f6
Improved code
albertolive 355e5e0
Clean stuff
albertolive e4e8966
initial handshake work
albertolive 8cd8b94
Merge branch 'develop' into MMI-4693-QR-code
albertolive 6259201
Merge branch 'develop' into MMI-4693-QR-code
albertolive 73a32e3
Improved code
albertolive c925859
Merge branch 'develop' into MMI-4693-QR-code
albertolive 7a8356a
Improving code
albertolive 5318444
Merge branch 'develop' into MMI-4693-QR-code
albertolive abd835a
Continue working on it
albertolive 14184b2
Merge branch 'MMI-4693-QR-code' of https://github.com/MetaMask/metama…
albertolive b81d203
Added logic to decrypt the connect request
albertolive c271122
Merge branch 'develop' into MMI-4693-QR-code
albertolive c0a55f9
Merge branch 'develop' into MMI-4693-QR-code
albertolive 244f554
updated packages, lavamoat and qr code modal
albertolive 53513b4
Merge branch 'develop' into MMI-4693-QR-code
albertolive 8793db8
Update LavaMoat policies
metamaskbot e3ae6de
improved qr modal component
albertolive 4e55314
Merge branch 'develop' into MMI-4693-QR-code
albertolive bccb5dc
Improved qr code modal
albertolive 6a1e6ef
Added unit tests
albertolive 114b00d
Added storybook story and improved tests
albertolive 00554ba
Added sentry errors
albertolive ae44c3b
Merge branch 'develop' into MMI-4693-QR-code
albertolive 7f7950d
fixed issues
albertolive 770b541
updated lavamoat
albertolive dff9172
Update LavaMoat policies
metamaskbot c5fc2f2
Fixed lavamoat
albertolive 65268de
chore: fix lavamoat and small code change
zone-live c62c3f2
Merge branch 'develop' into MMI-4693-QR-code
zone-live 996f2b7
Update LavaMoat policies
metamaskbot 0b7f644
chore: fix audit failing and test
zone-live f7af556
adding back connectRequest as is needed to listen for new connectRequ…
albertolive 8b081a3
Fixed tests, added e2e tests and improved code
albertolive 58c563f
test
albertolive b394db3
test
albertolive 471fc77
Merge branch 'develop' into MMI-4693-QR-code
albertolive d2619e5
Merge branch 'develop' into MMI-4693-QR-code
albertolive 6acd368
Merge branch 'develop' into MMI-4693-QR-code
albertolive 8d52d28
FIx PW issue
albertolive c8f0c47
Merge branch 'develop' into MMI-4693-QR-code
albertolive 2a10cef
Merge branch 'develop' into MMI-4693-QR-code
albertolive 0ad5890
remove console log
albertolive a1e90fb
Merge branch 'MMI-4693-QR-code' of https://github.com/MetaMask/metama…
albertolive 0b42348
updated to tsx
albertolive 5e113ab
move to tsx
albertolive 3ff89a2
fix tsx
albertolive 2124074
fixed tsx
albertolive 5f9e120
fix lint
albertolive 3703a12
Merge branch 'develop' into MMI-4693-QR-code
albertolive 546abb6
lint issues
albertolive a4afe1b
fix lint
albertolive 2e65fbe
fix lint
albertolive 5eff79d
test
zone-live 22b5e3a
test 2
zone-live 74e41d2
clean up
zone-live 38a9719
test 3
zone-live d63ae12
clean up test changes
zone-live 5b29830
test logging element
zone-live 014d577
test logging env var
zone-live 9e19a21
clean up
zone-live 8ecc17f
clean up
zone-live 87761a1
updates visual snapshots
zone-live File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,65 @@ | ||
import { type Page, type BrowserContext } from '@playwright/test'; | ||
import { test } from '../helpers/extension-loader'; | ||
import { ChromeExtensionPage } from '../pageObjects/mmi-extension-page'; | ||
import { MMIMainMenuPage } from '../pageObjects/mmi-mainMenu-page'; | ||
import { MMINetworkPage } from '../pageObjects/mmi-network-page'; | ||
import { MMISignUpPage } from '../pageObjects/mmi-signup-page'; | ||
import { MMIMainPage } from '../pageObjects/mmi-main-page'; | ||
import { MMIAccountMenuPage } from '../pageObjects/mmi-accountMenu-page'; | ||
import { CustodianTestClient } from '../custodian-hooks/hooks'; | ||
import { SEPOLIA_DISPLAY_NAME } from '../helpers/utils'; | ||
|
||
test.describe('QR Code Connection Request', () => { | ||
test('run the extension and add custodian accounts using the QR Code feature', async ({ | ||
page, | ||
context, | ||
}) => { | ||
const client = new CustodianTestClient(); | ||
await client.setup(); | ||
|
||
// Getting extension id of MMI | ||
const extensions = new ChromeExtensionPage(await context.newPage()); | ||
await extensions.goto(); | ||
await extensions.setDevMode(); | ||
const extensionId = await extensions.getExtensionId(); | ||
await extensions.close(); | ||
|
||
const signUp = new MMISignUpPage( | ||
await context.newPage(), | ||
extensionId as string, | ||
); | ||
await signUp.goto(); | ||
await signUp.start(); | ||
await signUp.authentication(); | ||
await signUp.info(); | ||
await signUp.close(); | ||
|
||
// Setup testnetwork in settings | ||
const mainMenuPage = new MMIMainMenuPage(page, extensionId as string); | ||
await mainMenuPage.goto(); | ||
await mainMenuPage.fillPassword(); | ||
await mainMenuPage.finishOnboarding(); | ||
await mainMenuPage.selectMenuOption('settings'); | ||
await mainMenuPage.selectSettings('Advance'); | ||
await mainMenuPage.switchTestNetwork(); | ||
await mainMenuPage.closeSettings(); | ||
|
||
// Check network | ||
const networkPage = new MMINetworkPage(page); | ||
await networkPage.open(); | ||
await networkPage.selectNetwork( | ||
process.env.MMI_E2E_TEST_NETWORK || SEPOLIA_DISPLAY_NAME, | ||
); | ||
|
||
// Get account from and to name | ||
const accountFrom = await client.getAccountFrom(); | ||
|
||
const accountsPopup = new MMIAccountMenuPage(page); | ||
await accountsPopup.accountsMenu(); | ||
await accountsPopup.connectCustodian('Neptune Custody', false, true); | ||
await accountsPopup.selectCustodyAccount(accountFrom); | ||
|
||
const mainPage = new MMIMainPage(page); | ||
await mainPage.bringToFront(); | ||
}); | ||
}); |
Binary file modified
BIN
+5.58 KB
(110%)
...i/specs/visual.spec.ts-snapshots/custodian-connection-info-mmi-visual-linux.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+466 Bytes
(100%)
test/e2e/mmi/specs/visual.spec.ts-snapshots/custodian-list-mmi-visual-linux.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
export { default } from './qr-code-modal'; |
50 changes: 50 additions & 0 deletions
50
ui/components/institutional/qr-code-modal/qr-code-modal.stories.tsx
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,50 @@ | ||
import React from 'react'; | ||
import { Meta, StoryFn } from '@storybook/react'; | ||
import { Provider } from 'react-redux'; | ||
import configureMockStore from 'redux-mock-store'; | ||
import QRCodeModal from './qr-code-modal'; | ||
|
||
const mockStore = configureMockStore(); | ||
const testData = { | ||
metamask: { | ||
institutionalFeatures: { | ||
channelId: 'channel123', | ||
connectionRequest: { | ||
payload: 'encryptedPayload', | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
const store = mockStore(testData); | ||
|
||
const meta: Meta<typeof QRCodeModal> = { | ||
title: 'Components/QRCodeModal', | ||
decorators: [ | ||
(storyFn: any) => <Provider store={store}>{storyFn()}</Provider>, | ||
], | ||
component: QRCodeModal, | ||
argTypes: { | ||
onClose: { action: 'closed' }, | ||
custodianName: { control: 'text' }, | ||
custodianURL: { control: 'text' }, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
const Template: StoryFn<typeof QRCodeModal> = (args) => ( | ||
<QRCodeModal {...args} /> | ||
); | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { | ||
custodianName: 'Test Custodian', | ||
custodianURL: 'http://testcustodian.com', | ||
}; | ||
|
||
export const WithError = Template.bind({}); | ||
WithError.args = { | ||
...Default.args, | ||
error: 'Failed to load data', | ||
}; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯