Skip to content

Commit

Permalink
Merge branch 'develop' into fix/notifications-tag-counter-width
Browse files Browse the repository at this point in the history
  • Loading branch information
matteoscurati authored Jun 14, 2024
2 parents 2f396d3 + 4aa2fd0 commit 4a25ca5
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 1 deletion.
86 changes: 86 additions & 0 deletions test/e2e/fixture-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,12 @@ class FixtureBuilder {
});
}

withPreferencesControllerTxSimulationsDisabled() {
return this.withPreferencesController({
useTransactionSimulations: false,
});
}

withAccountsController(data) {
merge(this.fixture.data.AccountsController, data);
return this;
Expand Down Expand Up @@ -814,8 +820,28 @@ class FixtureBuilder {
timestamp: 1631545992244,
value: false,
},
{
op: 'add',
path: '/simulationData',
value: {
error: {
code: 'disabled',
message: 'Simulation disabled',
},
tokenBalanceChanges: [],
},
note: 'TransactionController#updateSimulationData - Update simulation data',
timestamp: 1631545992244,
},
],
],
simulationData: {
error: {
code: 'disabled',
message: 'Simulation disabled',
},
tokenBalanceChanges: [],
},
id: '7087d1d7-f0e8-4c0f-a903-6d9daa392baf',
loadingDefaults: false,
origin: 'https://metamask.github.io',
Expand Down Expand Up @@ -869,8 +895,28 @@ class FixtureBuilder {
timestamp: 1631545994695,
value: false,
},
{
op: 'add',
path: '/simulationData',
value: {
error: {
code: 'disabled',
message: 'Simulation disabled',
},
tokenBalanceChanges: [],
},
note: 'TransactionController#updateSimulationData - Update simulation data',
timestamp: 1631545992244,
},
],
],
simulationData: {
error: {
code: 'disabled',
message: 'Simulation disabled',
},
tokenBalanceChanges: [],
},
id: '6eab4240-3762-4581-abc5-cd91eab6964e',
loadingDefaults: false,
origin: 'https://metamask.github.io',
Expand Down Expand Up @@ -924,8 +970,28 @@ class FixtureBuilder {
timestamp: 1631545996678,
value: false,
},
{
op: 'add',
path: '/simulationData',
value: {
error: {
code: 'disabled',
message: 'Simulation disabled',
},
tokenBalanceChanges: [],
},
note: 'TransactionController#updateSimulationData - Update simulation data',
timestamp: 1631545992244,
},
],
],
simulationData: {
error: {
code: 'disabled',
message: 'Simulation disabled',
},
tokenBalanceChanges: [],
},
id: 'c15eee26-11d6-4914-a70e-36ef9a3bcacb',
loadingDefaults: false,
origin: 'https://metamask.github.io',
Expand Down Expand Up @@ -979,8 +1045,28 @@ class FixtureBuilder {
timestamp: 1631545998677,
value: false,
},
{
op: 'add',
path: '/simulationData',
value: {
error: {
code: 'disabled',
message: 'Simulation disabled',
},
tokenBalanceChanges: [],
},
note: 'TransactionController#updateSimulationData - Update simulation data',
timestamp: 1631545992244,
},
],
],
simulationData: {
error: {
code: 'disabled',
message: 'Simulation disabled',
},
tokenBalanceChanges: [],
},
id: 'dfa9e5ad-d069-46b1-976e-a23734971d87',
loadingDefaults: false,
origin: 'https://metamask.github.io',
Expand Down
35 changes: 35 additions & 0 deletions test/e2e/tests/transaction/navigate-transactions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe('Navigate transactions', function () {
await withFixtures(
{
fixtures: new FixtureBuilder()
.withPreferencesControllerTxSimulationsDisabled()
.withTransactionControllerMultipleTransactions()
.build(),
ganacheOptions: generateGanacheOptions({ hardfork: 'london' }),
Expand All @@ -21,6 +22,12 @@ describe('Navigate transactions', function () {
async ({ driver }) => {
await unlockWallet(driver);

// Wait until total amount is loaded to mitigate flakiness on reject
await driver.findElement({
tag: 'span',
text: '3.0000315',
});

// navigate transactions
await driver.clickElement('[data-testid="next-page"]');
let navigationElement = await driver.findElement(
Expand Down Expand Up @@ -102,6 +109,7 @@ describe('Navigate transactions', function () {
dapp: true,
fixtures: new FixtureBuilder()
.withPermissionControllerConnectedToTestDapp()
.withPreferencesControllerTxSimulationsDisabled()
.withTransactionControllerMultipleTransactions()
.build(),
ganacheOptions: generateGanacheOptions({ hardfork: 'london' }),
Expand All @@ -110,6 +118,12 @@ describe('Navigate transactions', function () {
async ({ driver }) => {
await unlockWallet(driver);

// Wait until total amount is loaded to mitigate flakiness on reject
await driver.findElement({
tag: 'span',
text: '3.0000315',
});

await driver.clickElement('[data-testid="next-page"]');
let navigationElement = await driver.findElement(
'.confirm-page-container-navigation',
Expand Down Expand Up @@ -146,6 +160,7 @@ describe('Navigate transactions', function () {
await withFixtures(
{
fixtures: new FixtureBuilder()
.withPreferencesControllerTxSimulationsDisabled()
.withTransactionControllerMultipleTransactions()
.build(),
ganacheOptions: generateGanacheOptions({ hardfork: 'london' }),
Expand All @@ -154,6 +169,12 @@ describe('Navigate transactions', function () {
async ({ driver }) => {
await unlockWallet(driver);

// Wait until total amount is loaded to mitigate flakiness on reject
await driver.findElement({
tag: 'span',
text: '3.0000315',
});

// reject transaction
await driver.clickElement({ text: 'Reject', tag: 'button' });
const navigationElement = await driver.waitForSelector({
Expand All @@ -174,6 +195,7 @@ describe('Navigate transactions', function () {
await withFixtures(
{
fixtures: new FixtureBuilder()
.withPreferencesControllerTxSimulationsDisabled()
.withTransactionControllerMultipleTransactions()
.build(),
ganacheOptions: generateGanacheOptions({ hardfork: 'london' }),
Expand All @@ -182,6 +204,12 @@ describe('Navigate transactions', function () {
async ({ driver }) => {
await unlockWallet(driver);

// Wait until total amount is loaded to mitigate flakiness on reject
await driver.findElement({
tag: 'span',
text: '3.0000315',
});

// confirm transaction
await driver.clickElement({ text: 'Confirm', tag: 'button' });
const navigationElement = await driver.waitForSelector({
Expand All @@ -202,6 +230,7 @@ describe('Navigate transactions', function () {
await withFixtures(
{
fixtures: new FixtureBuilder()
.withPreferencesControllerTxSimulationsDisabled()
.withTransactionControllerMultipleTransactions()
.build(),
ganacheOptions: generateGanacheOptions({ hardfork: 'london' }),
Expand All @@ -210,6 +239,12 @@ describe('Navigate transactions', function () {
async ({ driver, ganacheServer }) => {
await unlockWallet(driver);

// Wait until total amount is loaded to mitigate flakiness on reject
await driver.findElement({
tag: 'span',
text: '3.0000315',
});

// reject transactions
await driver.clickElement({ text: 'Reject 4', tag: 'a' });
await driver.clickElement({ text: 'Reject all', tag: 'button' });
Expand Down
4 changes: 3 additions & 1 deletion ui/pages/routes/routes.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,9 @@ export default class Routes extends Component {
}
>
{shouldShowNetworkDeprecationWarning ? <DeprecatedNetworks /> : null}
{shouldShowNetworkInfo && <NewNetworkInfo />}
{location.pathname === DEFAULT_ROUTE && shouldShowNetworkInfo ? (
<NewNetworkInfo />
) : null}
<QRHardwarePopover />
<Modal />
<Alert visible={this.props.alertOpen} msg={alertMessage} />
Expand Down

0 comments on commit 4a25ca5

Please sign in to comment.