Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save alanbsmith/bf9fda4d90c49c2956a7dad72c298537 to your computer and use it in GitHub Desktop.

Select an option

Save alanbsmith/bf9fda4d90c49c2956a7dad72c298537 to your computer and use it in GitHub Desktop.
effective-testing-for-styled-components-simple-snapshot
import React from 'react';
import Button from '../index';
import renderer from 'react-test-renderer';
describe('Button Block', () => {
it('renders correctly', () => {
const tree = renderer
.create(<Button>Submit</Button>)
.toJSON();
expect(tree).toMatchSnapshot();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment