Skip to content

Commit

Permalink
fix: e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
micaelae committed Jul 24, 2024
1 parent 71565c0 commit 353ab3b
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 8 deletions.
12 changes: 11 additions & 1 deletion test/e2e/tests/bridge/bridge-test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,17 @@ const mockServer =
};
}),
);
return Promise.all(featureFlagMocks);
const portfolioMock = async () =>
await mockServer_
.forGet('https://portfolio.metamask.io/bridge')
.always()
.thenCallback(() => {
return {
statusCode: 200,
json: {},
};
});
return Promise.all([...featureFlagMocks, portfolioMock]);
};

export const getBridgeFixtures = (
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/tests/bridge/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { FeatureFlagResponse } from '../../../../ui/pages/bridge/bridge.util';

export const DEFAULT_FEATURE_FLAGS_RESPONSE: FeatureFlagResponse = {
'extension-support': false,
'src-network-allowlist': [1, 42161, 59144],
'dest-network-allowlist': [1, 42161, 59144],
};

export const LOCATOR = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,17 @@
},
"AuthenticationController": { "isSignedIn": "boolean" },
"BridgeController": {
"bridgeState": { "bridgeFeatureFlags": { "extensionSupport": "boolean" } }
"bridgeState": {
"bridgeFeatureFlags": {
"destNetworkAllowlist": {},
"extensionSupport": "boolean",
"srcNetworkAllowlist": {}
},
"destTokens": {},
"destTopAssets": {},
"srcTokens": {},
"srcTopAssets": {}
}
},
"CronjobController": { "jobs": "object" },
"CurrencyController": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,25 @@
"swapsStxMaxFeeMultiplier": 2,
"swapsFeatureFlags": {}
},
"bridgeState": { "bridgeFeatureFlags": { "extensionSupport": "boolean" } },
"bridgeState": {
"bridgeFeatureFlags": {
"extensionSupport": "boolean",
"srcNetworkAllowlist": {
"0": "string",
"1": "string",
"2": "string"
},
"destNetworkAllowlist": {
"0": "string",
"1": "string",
"2": "string"
}
},
"destTokens": {},
"destTopAssets": {},
"srcTokens": {},
"srcTopAssets": {}
},
"ensEntries": "object",
"ensResolutionsByAddress": "object",
"pendingApprovals": "object",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,14 @@
"BridgeController": {
"bridgeState": {
"bridgeFeatureFlags": {
"extensionSupport": "boolean"
}
"destNetworkAllowlist": {},
"extensionSupport": "boolean",
"srcNetworkAllowlist": {}
},
"destTokens": {},
"destTopAssets": {},
"srcTokens": {},
"srcTopAssets": {}
}
},
"SubjectMetadataController": { "subjectMetadata": "object" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,14 @@
"BridgeController": {
"bridgeState": {
"bridgeFeatureFlags": {
"extensionSupport": "boolean"
}
"extensionSupport": "boolean",
"srcNetworkAllowlist": {},
"destNetworkAllowlist": {}
},
"destTokens": {},
"destTopAssets": {},
"srcTokens": {},
"srcTopAssets": {}
}
},
"TransactionController": { "transactions": "object" },
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/tests/swap-send/swap-send-test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export const getSwapSendFixtures = (
const ETH_CONVERSION_RATE_USD = 3010;
return {
driverOptions: {
openDevToolsForTabs: true,
// openDevToolsForTabs: true,
},
fixtures: new FixtureBuilder()
.withPreferencesController({
Expand Down

0 comments on commit 353ab3b

Please sign in to comment.