Skip to content

Instantly share code, notes, and snippets.

@ErrorPro
Created May 17, 2018 06:53
Show Gist options
  • Select an option

  • Save ErrorPro/9cf92b7e2cf345c45fafb8d628a9f877 to your computer and use it in GitHub Desktop.

Select an option

Save ErrorPro/9cf92b7e2cf345c45fafb8d628a9f877 to your computer and use it in GitHub Desktop.
import React from 'react';
import Button from './Button';
import renderer from 'react-test-renderer';
test('renders button with passed props', () => {
const component = renderer.create(
<Button onClick={() => {}} label="test label" />
);
expect(component.toJSON()).toMatchSnapshot();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment