regexper-static/src/components/Message.test.js
Jeff Avallone 49a236bf89 Switching back to SVG components for icons
No longer need the hack to only use them in components while URLs are
used in styles since I don't need icons in the styles anymore. Embedding
the markup also provides the option to restyle the icons
2018-02-11 06:58:59 -05:00

26 lines
617 B
JavaScript

import React from 'react';
import renderer from 'react-test-renderer';
import Message from './Message';
test('Message rendering', () => {
const component = renderer.create(
<Message heading="Testing">
<p>Message content</p>
</Message>
);
let tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
test('Message rendering with icon', () => {
const Icon = () => 'Sample icon SVG';
const component = renderer.create(
<Message heading="Testing" icon={ Icon }>
<p>Message content</p>
</Message>
);
let tree = component.toJSON();
expect(tree).toMatchSnapshot();
});