Skip to content

Commit

Permalink
Merge branch 'main' into test/remove-list-notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
tommasini authored Nov 13, 2024
2 parents 86a1b50 + 282cc80 commit 235fcb9
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions app/core/RPCMethods/wallet_addEthereumChain.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,42 @@ describe('RPC Method - wallet_addEthereumChain', () => {
}
});

it('should report native currency symbol length being too long', async () => {
const symbol = 'aaaaaaaaaaaaaaa';
await expect(
wallet_addEthereumChain({
req: {
params: [{
...correctParams,
nativeCurrency: { symbol, decimals: 18 },
}],
},
...otherOptions,
}),
).rejects.toThrow(
`Expected 1-6 character string 'nativeCurrency.symbol'. Received:\n${symbol}`,
);
});

it('should allow 1 letter native currency symbols', async () => {
jest.mock('./networkChecker.util');
jest
.spyOn(Engine.context.NetworkController, 'addNetwork')
.mockResolvedValue({ rpcEndpoints: [] });

await wallet_addEthereumChain({
req: {
params: [
{
...correctParams,
nativeCurrency: { symbol: 'a', decimals: 18 },
},
],
},
...otherOptions,
});
});

describe('Approval Flow', () => {
it('should start and end a new approval flow if chain does not already exist', async () => {
jest
Expand Down

0 comments on commit 235fcb9

Please sign in to comment.