regexper-static/src/components/Message/test.js
2019-01-04 18:38:49 -05:00

35 lines
813 B
JavaScript

import React from 'react';
import { shallow } from 'enzyme';
import Message from 'components/Message';
describe('Message', () => {
test('rendering', () => {
const component = shallow(
<Message heading="Testing">
<p>Message content</p>
</Message>
);
expect(component).toMatchSnapshot();
});
test('rendering with icon', () => {
const Icon = () => 'Sample icon SVG';
const component = shallow(
<Message heading="Testing" icon={ Icon }>
<p>Message content</p>
</Message>
);
expect(component).toMatchSnapshot();
});
test('rendering with type', () => {
const component = shallow(
<Message heading="Testing" type="error">
<p>Message content</p>
</Message>
);
expect(component).toMatchSnapshot();
});
});