Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Davi Medeiros committed Jun 24, 2018
1 parent 0e40ca4 commit 9eb39e7
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/components/theme/Icon/Icon.test.jsx
@@ -0,0 +1,23 @@
import React from 'react';
import renderer from 'react-test-renderer';
import Icon from './Icon';

test.only('Renders icon', () => {
const component = renderer.create(
<Icon
size="14px"
color="#007bc1"
className="my-icon"
title="My Icon"
name={{
attributes: {
xmlns: 'http://www.w3.org/2000/svg',
viewBox: '0 0 36 36',
},
content: 'Accessibility',
}}
/>,
);
const json = component.toJSON();
expect(json).toMatchSnapshot();
});
21 changes: 21 additions & 0 deletions src/components/theme/Icon/__snapshots__/Icon.test.jsx.snap
@@ -0,0 +1,21 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Renders icon 1`] = `
<svg
className="icon my-icon"
dangerouslySetInnerHTML={
Object {
"__html": "<title>My Icon</title>Accessibility",
}
}
style={
Object {
"fill": "#007bc1",
"height": "14px",
"width": "auto",
}
}
viewBox="0 0 36 36"
xmlns="http://www.w3.org/2000/svg"
/>
`;

0 comments on commit 9eb39e7

Please sign in to comment.