Last active
March 2, 2018 15:51
-
-
Save bruceharris/dae58244e4d9a2e87fdc9284396f117f to your computer and use it in GitHub Desktop.
React Unit Testing Example 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
import React from 'react'; | |
import { mount } from 'enzyme'; | |
import LoadingIndicator from './LoadingIndicator' | |
describe('LoadingIndicator', () => { | |
describe('when isLoading is false', () => { | |
it('should render children', () => { | |
const wrapper = mount( | |
<LoadingIndicator isLoading={false}> | |
<div>ahoy!</div> | |
</LoadingIndicator> | |
); | |
expect(wrapper.html()).toEqual('<div>ahoy!</div>'); | |
wrapper.unmount(); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment