Created
February 20, 2017 22:57
-
-
Save ricca509/8504e0c2fa01d912817c20a0d3e6ed87 to your computer and use it in GitHub Desktop.
snapshot-component-test-2
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
// BuyNow.test.jsx | |
import { shallow } from 'enzyme'; | |
import toJson from 'enzyme-to-json'; | |
import BuyNow from '../BuyNow'; | |
describe('The BuyNow component', () => { | |
it('renders the right price and button', () => { | |
const props = { price: 25, text: 'Buy now' }; | |
const tree = shallow(<BuyNow {...props} />); | |
expect(toJson(tree)).toMatchSnapshot(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment