Skip to content
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

test(TXL-308): initial e2e for stx using swaps #27215

Merged
merged 17 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions privacy-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"test.metamask-phishing.io",
"token.api.cx.metamask.io",
"tokens.api.cx.metamask.io",
"transaction.api.cx.metamask.io",
"tx-sentinel-ethereum-mainnet.api.cx.metamask.io",
"unresponsive-rpc.test",
"unresponsive-rpc.url",
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/default-fixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ function defaultFixture(inputChainId = CHAIN_IDS.LOCALHOST) {
SmartTransactionsController: {
smartTransactionsState: {
fees: {},
feesByChainId: {},
liveness: true,
livenessByChainId: {},
smartTransactions: {
[CHAIN_IDS.MAINNET]: [],
},
Expand Down
8 changes: 8 additions & 0 deletions test/e2e/fixture-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,14 @@ class FixtureBuilder {
});
}

withPreferencesControllerSmartTransactionsOptedIn() {
return this.withPreferencesController({
preferences: {
smartTransactionsOptInStatus: true,
},
});
}

withPreferencesControllerAndFeatureFlag(flags) {
merge(this.fixture.data.PreferencesController, flags);
return this;
Expand Down
58 changes: 28 additions & 30 deletions test/e2e/mock-e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,35 +272,33 @@ async function setupMocking(
.thenCallback(() => {
return {
statusCode: 200,
json: [
{
ethereum: {
fallbackToV1: false,
mobileActive: true,
extensionActive: true,
},
bsc: {
fallbackToV1: false,
mobileActive: true,
extensionActive: true,
},
polygon: {
fallbackToV1: false,
mobileActive: true,
extensionActive: true,
},
avalanche: {
fallbackToV1: false,
mobileActive: true,
extensionActive: true,
},
smartTransactions: {
mobileActive: false,
extensionActive: false,
},
updated_at: '2022-03-17T15:54:00.360Z',
json: {
ethereum: {
fallbackToV1: false,
mobileActive: true,
extensionActive: true,
},
],
bsc: {
fallbackToV1: false,
mobileActive: true,
extensionActive: true,
},
polygon: {
fallbackToV1: false,
mobileActive: true,
extensionActive: true,
},
avalanche: {
fallbackToV1: false,
mobileActive: true,
extensionActive: true,
},
smartTransactions: {
mobileActive: false,
extensionActive: true,
},
updated_at: '2022-03-17T15:54:00.360Z',
},
};
});

Expand Down Expand Up @@ -470,7 +468,7 @@ async function setupMocking(
decimals: 18,
name: 'Dai Stablecoin',
iconUrl:
'https://crypto.com/price/coin-data/icon/DAI/color_icon.png',
'https://static.cx.metamask.io/api/v1/tokenIcons/1/0x6b175474e89094c44da98b954eedeac495271d0f.png',
type: 'erc20',
aggregators: [
'aave',
Expand All @@ -497,7 +495,7 @@ async function setupMocking(
decimals: 6,
name: 'USD Coin',
iconUrl:
'https://crypto.com/price/coin-data/icon/USDC/color_icon.png',
'https://static.cx.metamask.io/api/v1/tokenIcons/1/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.png',
type: 'erc20',
aggregators: [
'aave',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@
"SmartTransactionsController": {
"smartTransactionsState": {
"fees": {},
"feesByChainId": "object",
"liveness": true,
"livenessByChainId": "object",
"smartTransactions": "object"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@
"allDetectedTokens": {},
"smartTransactionsState": {
"fees": {},
"feesByChainId": "object",
"liveness": true,
"livenessByChainId": "object",
"smartTransactions": "object"
},
"allNftContracts": "object",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,23 @@
},
"snapsInstallPrivacyWarningShown": true
},
"BridgeController": {
"bridgeState": {
"bridgeFeatureFlags": {
"extensionSupport": "boolean",
"srcNetworkAllowlist": {
"0": "string",
"1": "string",
"2": "string"
},
"destNetworkAllowlist": {
"0": "string",
"1": "string",
"2": "string"
}
}
}
},
"CurrencyController": {
"currentCurrency": "usd",
"currencyRates": {
Expand Down Expand Up @@ -138,7 +155,9 @@
"SmartTransactionsController": {
"smartTransactionsState": {
"fees": {},
"feesByChainId": "object",
"liveness": true,
"livenessByChainId": "object",
"smartTransactions": "object"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,23 @@
},
"snapsInstallPrivacyWarningShown": true
},
"BridgeController": {
"bridgeState": {
"bridgeFeatureFlags": {
"extensionSupport": "boolean",
"srcNetworkAllowlist": {
"0": "string",
"1": "string",
"2": "string"
},
"destNetworkAllowlist": {
"0": "string",
"1": "string",
"2": "string"
}
}
}
},
"CurrencyController": {
"currentCurrency": "usd",
"currencyRates": {
Expand Down Expand Up @@ -138,7 +155,9 @@
"SmartTransactionsController": {
"smartTransactionsState": {
"fees": {},
"feesByChainId": "object",
"liveness": true,
"livenessByChainId": "object",
"smartTransactions": "object"
}
},
Expand Down
Loading