-
Notifications
You must be signed in to change notification settings - Fork 5.2k
test: fix stx opt-in opt-out fixture #33264
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 all commits
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 |
---|---|---|
|
@@ -845,20 +845,14 @@ class FixtureBuilder { | |
}); | ||
} | ||
|
||
withPreferencesControllerSmartTransactionsOptedIn() { | ||
return this.withPreferencesController({ | ||
preferences: { | ||
smartTransactionsOptInStatus: true, | ||
tokenNetworkFilter: {}, | ||
}, | ||
}); | ||
} | ||
|
||
/** | ||
* @deprecated this method should not be used, as the `smartTransactionsOptInStatus` value is overridden by the migration 135 | ||
* Use the `toggleStxSetting` flow to disable this setting effectively. | ||
*/ | ||
withPreferencesControllerSmartTransactionsOptedOut() { | ||
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. ℹ️ leaving the method with the |
||
return this.withPreferencesController({ | ||
preferences: { | ||
smartTransactionsOptInStatus: false, | ||
tokenNetworkFilter: {}, | ||
}, | ||
}); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Driver } from '../../webdriver/driver'; | ||
import AdvancedSettings from '../pages/settings/advanced-settings'; | ||
import HeaderNavbar from '../pages/header-navbar'; | ||
import SettingsPage from '../pages/settings/settings-page'; | ||
|
||
/** | ||
* Toggle the Smart Transactions (STX) option from the Advance settings. | ||
* | ||
* @param driver - The driver instance. | ||
*/ | ||
export async function toggleStxSetting(driver: Driver) { | ||
const headerNavbar = new HeaderNavbar(driver); | ||
await headerNavbar.check_pageIsLoaded(); | ||
await headerNavbar.openSettingsPage(); | ||
|
||
const settingsPage = new SettingsPage(driver); | ||
await settingsPage.check_pageIsLoaded(); | ||
await settingsPage.clickAdvancedTab(); | ||
const advancedSettingsPage = new AdvancedSettings(driver); | ||
await advancedSettingsPage.check_pageIsLoaded(); | ||
await advancedSettingsPage.toggleSmartTransactions(); | ||
await settingsPage.closeSettingsPage(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,6 @@ describe('Gas Fee Tokens - Smart Transactions', function (this: Suite) { | |
dapp: true, | ||
fixtures: new FixtureBuilder({ inputChainId: CHAIN_IDS.MAINNET }) | ||
.withPermissionControllerConnectedToTestDapp() | ||
.withPreferencesControllerSmartTransactionsOptedIn() | ||
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. this is already true by default |
||
.withNetworkControllerOnMainnet() | ||
.build(), | ||
localNodeOptions: { | ||
|
@@ -84,7 +83,6 @@ describe('Gas Fee Tokens - Smart Transactions', function (this: Suite) { | |
dapp: true, | ||
fixtures: new FixtureBuilder({ inputChainId: CHAIN_IDS.MAINNET }) | ||
.withPermissionControllerConnectedToTestDapp() | ||
.withPreferencesControllerSmartTransactionsOptedIn() | ||
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. this is already true by default |
||
.withNetworkControllerOnMainnet() | ||
.build(), | ||
localNodeOptions: { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,6 @@ async function withFixturesForSmartTransactions( | |
{ | ||
fixtures: new FixtureBuilder() | ||
.withPermissionControllerConnectedToTestDapp() | ||
.withPreferencesControllerSmartTransactionsOptedIn() | ||
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. this is already true by default |
||
.withNetworkControllerOnMainnet() | ||
.build(), | ||
title, | ||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
we don't need this method as the opt in status is already in the default fixture, or it is set to true by default in the onboarding case