You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Tag:
Branch:
Tree:
263e80da5e
develop
feature/default_network_editable
v10.22.3
${ noResults }
41 lines
1.4 KiB
41 lines
1.4 KiB
import React from 'react';
|
|||
import { shallow } from 'enzyme';
|
|||
import Button from '../../../ui/button';
|
|||
import TransactionBreakdownRow from './transaction-breakdown-row.component';
|
|||
|
|
||
describe('TransactionBreakdownRow Component', () => {
|
|||
it('should render text properly', () => {
|
|||
|
const wrapper = shallow(
|
||
|
<TransactionBreakdownRow title="test" className="test-class">
|
||
|
Test
|
||
</TransactionBreakdownRow>,
|
|||
{ context: { t: (str1, str2) => (str2 ? str1 + str2 : str1) } },
|
|||
);
|
|||
|
|
||
expect(wrapper.hasClass('transaction-breakdown-row')).toStrictEqual(true);
|
|||
expect(
|
|||
|
wrapper.find('.transaction-breakdown-row__title').text(),
|
||
).toStrictEqual('test');
|
|||
expect(
|
|||
|
wrapper.find('.transaction-breakdown-row__value').text(),
|
||
).toStrictEqual('Test');
|
|||
});
|
|||
|
|
||
it('should render components properly', () => {
|
|||
|
const wrapper = shallow(
|
||
|
<TransactionBreakdownRow title="test" className="test-class">
|
||
<Button onClick={() => undefined}>Button</Button>
|
|||
|
</TransactionBreakdownRow>,
|
||
{ context: { t: (str1, str2) => (str2 ? str1 + str2 : str1) } },
|
|||
);
|
|||
|
|
||
expect(wrapper.hasClass('transaction-breakdown-row')).toStrictEqual(true);
|
|||
expect(
|
|||
|
wrapper.find('.transaction-breakdown-row__title').text(),
|
||
).toStrictEqual('test');
|
|||
expect(
|
|||
wrapper.find('.transaction-breakdown-row__value').find(Button),
|
|||
).toHaveLength(1);
|
|||
});
|
|||
});
|