Skip to content

Instantly share code, notes, and snippets.

@bruceharris
Created March 2, 2018 16:06
Show Gist options
  • Save bruceharris/5d95880def344ecf3bf9d45211db2aef to your computer and use it in GitHub Desktop.
Save bruceharris/5d95880def344ecf3bf9d45211db2aef to your computer and use it in GitHub Desktop.
React Unit Testing Example 5
describe('when isLoading is true', () => {
describe('given 200ms have not yet elapsed', () => {
it('should render nothing', () => {
const wrapper = mount(
<LoadingIndicator isLoading={true}>
<div>ahoy!</div>
</LoadingIndicator>
);
expect(wrapper.html()).toBe(null);
wrapper.unmount();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment