2021-02-04 19:15:23 +01:00
|
|
|
import React from 'react';
|
2021-04-28 21:53:59 +02:00
|
|
|
import { shallowWithContext } from '../../../../test/lib/render-helpers';
|
2021-03-16 22:00:08 +01:00
|
|
|
import SignatureRequest from './signature-request.component';
|
2019-11-04 13:40:46 +01:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
describe('Signature Request Component', () => {
|
|
|
|
describe('render', () => {
|
2021-02-04 19:15:23 +01:00
|
|
|
const fromAddress = '0x123456789abcdef';
|
2021-04-15 20:01:46 +02:00
|
|
|
it('should render a div with one child', () => {
|
2021-04-28 21:53:59 +02:00
|
|
|
const wrapper = shallowWithContext(
|
2020-02-11 17:51:13 +01:00
|
|
|
<SignatureRequest
|
2020-08-14 13:47:02 +02:00
|
|
|
clearConfirmTransaction={() => undefined}
|
|
|
|
cancel={() => undefined}
|
|
|
|
sign={() => undefined}
|
2020-02-11 17:51:13 +01:00
|
|
|
txData={{
|
|
|
|
msgParams: {
|
|
|
|
data: '{"message": {"from": {"name": "hello"}}}',
|
2020-03-06 22:34:56 +01:00
|
|
|
from: fromAddress,
|
2020-02-11 17:51:13 +01:00
|
|
|
},
|
|
|
|
}}
|
2020-03-06 22:34:56 +01:00
|
|
|
fromAccount={{ address: fromAddress }}
|
2020-11-03 00:41:28 +01:00
|
|
|
/>,
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2019-11-04 13:40:46 +01:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
expect(wrapper.is('div')).toStrictEqual(true);
|
|
|
|
expect(wrapper).toHaveLength(1);
|
|
|
|
expect(wrapper.hasClass('signature-request')).toStrictEqual(true);
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|