Repository navigation
test: remove withSolanaAccountSnap as we have default Multichain support in all our e2e
#40327
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
Changes from 13 commits
dc9745b
c4700df
f67bab3
9081070
c7d5849
24179e0
66984ff
354f9ba
cd7f290
79a8b66
64fb46d
795209e
603053e
11e368a
891c68a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -160,6 +160,14 @@ class FixtureBuilderV2 { | |
| }); | ||
| } | ||
|
|
||
| withShowNativeTokenAsMainBalanceDisabled(): this { | ||
| return this.withPreferencesController({ | ||
| preferences: { | ||
| showNativeTokenAsMainBalance: false, | ||
| }, | ||
| }); | ||
| } | ||
|
|
||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. needed because now I'm using FixtureBuilderV2 in a spec which was using this method from the legacy fixture builder |
||
| build() { | ||
| return this.fixture; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,27 @@ | ||
| import { strict as assert } from 'assert'; | ||
| import { By } from 'selenium-webdriver'; | ||
| import { largeDelayMs } from '../../../helpers'; | ||
| import { largeDelayMs, withFixtures } from '../../../helpers'; | ||
| import { SOLANA_MAINNET_SCOPE } from '../../../constants'; | ||
| import FixtureBuilderV2 from '../../../fixtures/fixture-builder-v2'; | ||
| import { loginWithBalanceValidation } from '../../../page-objects/flows/login.flow'; | ||
| import { addAccount } from '../../../page-objects/flows/add-account.flow'; | ||
| import TestDappMultichain from '../../../page-objects/pages/test-dapp-multichain'; | ||
| import { DEFAULT_MULTICHAIN_TEST_DAPP_FIXTURE_OPTIONS } from '../testHelpers'; | ||
| import { withSolanaAccountSnap } from '../../../tests/solana/common-solana'; | ||
|
|
||
| describe('Multichain API - Non EVM', function () { | ||
| const SOLANA_SCOPE = 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp'; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can use the one in the constants file |
||
| describe("Call `wallet_createSession` with both EVM and Solana scopes that match the user's enabled networks", function () { | ||
| it('should only select the specified scopes requested by the user', async function () { | ||
| await withSolanaAccountSnap( | ||
| await withFixtures( | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can use the default fixtures out of the box. No need to additional layer of abstraction |
||
| { | ||
| ...DEFAULT_MULTICHAIN_TEST_DAPP_FIXTURE_OPTIONS, | ||
| fixtures: new FixtureBuilderV2().build(), | ||
| title: this.test?.fullTitle(), | ||
| }, | ||
| async (driver, _, extensionId) => { | ||
| async ({ driver, extensionId }) => { | ||
| await loginWithBalanceValidation(driver); | ||
| const requestScopesToNetworkMap = { | ||
| 'eip155:1': 'Ethereum', | ||
| [SOLANA_SCOPE]: 'Solana', | ||
| [SOLANA_MAINNET_SCOPE]: 'Solana', | ||
| }; | ||
|
|
||
| const requestScopes = Object.keys(requestScopesToNetworkMap); | ||
|
|
@@ -72,17 +76,20 @@ describe('Multichain API - Non EVM', function () { | |
|
|
||
| describe('Connect wallet to the multichain dapp via `externally_connectable`, call `wallet_createSession` with Solana scope, without any accounts requested', function () { | ||
| it('should automatically select the current active Solana account', async function () { | ||
| await withSolanaAccountSnap( | ||
| await withFixtures( | ||
| { | ||
| ...DEFAULT_MULTICHAIN_TEST_DAPP_FIXTURE_OPTIONS, | ||
| fixtures: new FixtureBuilderV2().build(), | ||
| title: this.test?.fullTitle(), | ||
| numberOfAccounts: 2, | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in the |
||
| }, | ||
| async (driver, _, extensionId) => { | ||
| async ({ driver, extensionId }) => { | ||
| await loginWithBalanceValidation(driver); | ||
| await addAccount({ driver, switchToAccount: 'Account 1' }); | ||
|
|
||
| const testDapp = new TestDappMultichain(driver); | ||
| await testDapp.openTestDappPage(); | ||
| await testDapp.connectExternallyConnectable(extensionId); | ||
| await testDapp.initCreateSessionScopes([SOLANA_SCOPE]); | ||
| await testDapp.initCreateSessionScopes([SOLANA_MAINNET_SCOPE]); | ||
|
|
||
| const editButtons = await driver.findElements('[data-testid="edit"]'); | ||
| await editButtons[0].click(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.