Skip to content

Commit

Permalink
test: add network lists to e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
micaelae committed Aug 13, 2024
1 parent 27be7d2 commit 663fe2f
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 7 deletions.
4 changes: 2 additions & 2 deletions test/e2e/default-fixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ function defaultFixture(inputChainId = CHAIN_IDS.LOCALHOST) {
BridgeController: {
bridgeState: {
bridgeFeatureFlags: {
destNetworkAllowlist: [],
extensionSupport: false,
srcNetworkAllowlist: [],
srcNetworkAllowlist: ['0x1', '0xa', '0xe708'],
destNetworkAllowlist: ['0x1', '0xa', '0xe708'],
},
},
},
Expand Down
13 changes: 13 additions & 0 deletions test/e2e/fixture-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,19 @@ class FixtureBuilder {
return this;
}

withBridgeControllerDefaultState() {
this.fixture.data.BridgeController = {
bridgeState: {
bridgeFeatureFlags: {
destNetworkAllowlist: [],
extensionSupport: false,
srcNetworkAllowlist: [],
},
},
};
return this;
}

withPermissionControllerConnectedToTestDapp(restrictReturnedAccounts = true) {
return this.withPermissionController({
subjects: {
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/tests/bridge/bridge-test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ export const getBridgeFixtures = (
inputChainId: CHAIN_IDS.MAINNET,
})
.withNetworkControllerOnMainnet()
.withCurrencyController(MOCK_CURRENCY_RATES);
.withCurrencyController(MOCK_CURRENCY_RATES)
.withBridgeControllerDefaultState();

if (withErc20) {
fixtureBuilder.withTokensControllerERC20();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,17 @@
"BridgeController": {
"bridgeState": {
"bridgeFeatureFlags": {
"destNetworkAllowlist": {},
"extensionSupport": "boolean",
"srcNetworkAllowlist": {}
"srcNetworkAllowlist": {
"0": "string",
"1": "string",
"2": "string"
},
"destNetworkAllowlist": {
"0": "string",
"1": "string",
"2": "string"
}
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,16 @@
"bridgeState": {
"bridgeFeatureFlags": {
"extensionSupport": "boolean",
"srcNetworkAllowlist": {},
"destNetworkAllowlist": {}
"srcNetworkAllowlist": {
"0": "string",
"1": "string",
"2": "string"
},
"destNetworkAllowlist": {
"0": "string",
"1": "string",
"2": "string"
}
}
}
},
Expand Down

0 comments on commit 663fe2f

Please sign in to comment.