2021-02-04 19:15:23 +01:00
|
|
|
import React from 'react';
|
|
|
|
import { render } from 'enzyme';
|
2021-03-16 22:00:08 +01:00
|
|
|
import SelectedAccount from './selected-account.component';
|
2018-09-15 22:31:21 +02:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
describe('SelectedAccount Component', () => {
|
|
|
|
it('should render checksummed address', () => {
|
2020-11-03 00:41:28 +01:00
|
|
|
const wrapper = render(
|
2019-12-03 17:35:44 +01:00
|
|
|
<SelectedAccount
|
2020-11-03 00:41:28 +01:00
|
|
|
selectedIdentity={{
|
|
|
|
name: 'testName',
|
|
|
|
address: '0x1b82543566f41a7db9a9a75fc933c340ffb55c9d',
|
|
|
|
}}
|
|
|
|
/>,
|
|
|
|
{ context: { t: () => undefined } },
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2018-09-15 22:31:21 +02:00
|
|
|
// Checksummed version of address is displayed
|
2021-04-15 20:01:46 +02:00
|
|
|
expect(wrapper.find('.selected-account__address').text()).toStrictEqual(
|
2021-10-13 19:54:48 +02:00
|
|
|
'0x1B8...5C9D',
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2021-04-15 20:01:46 +02:00
|
|
|
expect(wrapper.find('.selected-account__name').text()).toStrictEqual(
|
2020-12-03 16:46:22 +01:00
|
|
|
'testName',
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|