Skip to content

Commit

Permalink
remove useless test
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeRx committed Oct 24, 2024
1 parent d97748a commit 23f1950
Showing 1 changed file with 0 additions and 108 deletions.
108 changes: 0 additions & 108 deletions ui/selectors/selectors.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2005,112 +2005,4 @@ describe('#getConnectedSitesList', () => {
expect(selectors.getSelectedEvmInternalAccount(state)).toBe(undefined);
});
});

describe('getAddressBookByNetwork', () => {
it('returns the address book for the given network', () => {
expect(selectors.getAddressBookByNetwork(mockState, '0x5')).toStrictEqual(
[
{
address: '0xc42edfcc21ed14dda456aa0756c153f7985d8813',
chainId: '0x5',
isEns: false,
memo: '',
name: 'Address Book Account 1',
},
],
);
});

it('returns an empty object if no address book is found for the given network', () => {
expect(selectors.getAddressBookByNetwork(mockState, '0x1')).toStrictEqual(
[],
);
});
});

describe('getAddressBookEntryByNetwork', () => {
it('returns the address book entry for the given network and address', () => {
expect(
selectors.getAddressBookEntryByNetwork(
mockState,

'0xc42edfcc21ed14dda456aa0756c153f7985d8813',
'0x5',
),
).toStrictEqual({
address: '0xc42edfcc21ed14dda456aa0756c153f7985d8813',
chainId: '0x5',
isEns: false,
memo: '',
name: 'Address Book Account 1',
});
});

it('returns `undefined` if no entry is found for the given network and address', () => {
expect(
selectors.getAddressBookEntryByNetwork(
mockState,
'0xc42edfcc21ed14dda456aa0756c153f7985d8813',
'0x1',
),
).toBe(undefined);
});
});

describe('getAddressDisplayName', () => {
it('returns the account name', () => {
expect(
selectors.getAddressDisplayName(
mockState,
'eip155:1:0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc',
),
).toBe('Test Account');
});

it('returns the address book entry', () => {
const state = {
metamask: {
internalAccounts: {
accounts: [],
},
addressBook: {
'0x1': {
'0xc42edfcc21ed14dda456aa0756c153f7985d8813': {
address: '0xc42edfcc21ed14dda456aa0756c153f7985d8813',
chainId: '0x1',
isEns: false,
memo: '',
name: 'Address Book Account 1',
},
},
},
},
};

expect(
selectors.getAddressDisplayName(
state,
'eip155:1:0xc42edfcc21ed14dda456aa0756c153f7985d8813',
),
).toBe('Address Book Account 1');
});

it('returns null if no entry is found', () => {
const state = {
metamask: {
internalAccounts: {
accounts: [],
},
addressBook: {},
},
};

expect(
selectors.getAddressDisplayName(
state,
'eip155:1:0xc42edfcc21ed14dda456aa0756c153f7985d8813',
),
).toBe(undefined);
});
});
});

0 comments on commit 23f1950

Please sign in to comment.