1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-23 03:36:18 +02:00
metamask-extension/ui/components/app/signature-request/signature-request.component.test.js

30 lines
951 B
JavaScript
Raw Normal View History

import React from 'react';
import { shallowWithContext } from '../../../../test/lib/render-helpers';
import SignatureRequest from './signature-request.component';
describe('Signature Request Component', () => {
describe('render', () => {
const fromAddress = '0x123456789abcdef';
it('should render a div with one child', () => {
const wrapper = shallowWithContext(
<SignatureRequest
clearConfirmTransaction={() => undefined}
cancel={() => undefined}
sign={() => undefined}
txData={{
msgParams: {
data: '{"message": {"from": {"name": "hello"}}}',
from: fromAddress,
},
}}
fromAccount={{ address: fromAddress }}
2020-11-03 00:41:28 +01:00
/>,
);
expect(wrapper.is('div')).toStrictEqual(true);
expect(wrapper).toHaveLength(1);
expect(wrapper.hasClass('signature-request')).toStrictEqual(true);
});
});
});