Skip to content

Commit

Permalink
Add another test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrtenz committed Aug 15, 2024
1 parent 166308c commit 38edd7a
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions app/scripts/migrations/126.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,48 @@ describe('migration #126', () => {
});
});

it('uses the network from network configurations if set', async () => {
const oldStorage = getMockState(NETWORK_TYPES.SEPOLIA, {
[NETWORK_TYPES.SEPOLIA]: {
chainId: CHAIN_IDS.LINEA_SEPOLIA,
},
});

const newStorage = await migrate(oldStorage);
expect(newStorage.data.PermissionController).toStrictEqual({
subjects: {
[MOCK_SNAP_ID]: {
permissions: {
[SnapEndowments.EthereumProvider]: {
caveats: [],
date: 1664187844588,
id: 'izn0WGUO8cvq_jqvLQuQP',
invoker: MOCK_ORIGIN,
parentCapability: SnapEndowments.EthereumProvider,
},
[PermissionNames.permittedChains]: {
caveats: [
CaveatFactories[CaveatTypes.restrictNetworkSwitching](
[CHAIN_IDS.LINEA_SEPOLIA],
)
],
date: 1723635247705,
id: expect.any(String),
invoker: MOCK_SNAP_ID,
parentCapability: PermissionNames.permittedChains,
}
},
},
}
});

expect(newStorage.data.SelectedNetworkController).toStrictEqual({
domains: {
[MOCK_SNAP_ID]: NETWORK_TYPES.SEPOLIA
}
});
});

// @ts-expect-error - Property `each` does not exist on type `TestFunction`.
it.each([
{},
Expand Down

0 comments on commit 38edd7a

Please sign in to comment.