Created
December 8, 2017 21:41
-
-
Save alanbsmith/6fa2c174fb7d3145ef926dacb3b5a6c2 to your computer and use it in GitHub Desktop.
effective-testing-for-styled-components-icon-test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // lib/elements/Icon/__tests__/index.js | |
| import React from 'react'; | |
| import Icon from '../index'; | |
| import 'jest-styled-components'; | |
| import renderer from 'react-test-renderer'; | |
| describe('Icon Element', () => { | |
| it('renders correctly', () => { | |
| const tree = renderer.create( | |
| <Icon name="home" /> | |
| ).toJSON(); | |
| expect(tree).toMatchSnapshot(); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment