Last active
December 2, 2018 15:54
-
-
Save productioncoder/6213d7341156c62b056ec680d0ae8a67 to your computer and use it in GitHub Desktop.
Snapshot testing components with different props
This file contains 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
import React from 'react'; | |
import {shallow} from 'enzyme'; | |
import {Subscription} from '../Subscription'; | |
describe('Subscription', () => { | |
test('renders empty subscription', () => { | |
const wrapper = shallow( | |
<Subscription/> | |
); | |
expect(wrapper).toMatchSnapshot(); | |
}); | |
test('renders broadcasting subscription', () => { | |
const wrapper = shallow( | |
<Subscription broadcasting label='Productioncoder'/> | |
); | |
expect(wrapper).toMatchSnapshot(); | |
}); | |
test('renders non-broadcasting subscription with new videos', () => { | |
const wrapper = shallow( | |
<Subscription amountNewVideos={4} label='Productioncoder'/> | |
); | |
expect(wrapper).toMatchSnapshot(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment