Skip to content

Commit

Permalink
Failing test – render loading indicator when delay has elapsed
Browse files Browse the repository at this point in the history
  • Loading branch information
bruceharris committed Dec 6, 2017
1 parent 5a7d8c1 commit 706f34f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/components/LoadingIndicator.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,19 @@ describe('LoadingIndicator', () => {
wrapper.unmount();
});
});

describe('given 200ms have elapsed', () => {
it('should render loading indicator', () => {
jest.useFakeTimers();
const wrapper = mount(
<LoadingIndicator isLoading={true}>
<div>ahoy!</div>
</LoadingIndicator>
);
jest.runAllTimers();
expect(wrapper.html()).toBe('<div>loading...</div>');
wrapper.unmount();
});
});
});
});

0 comments on commit 706f34f

Please sign in to comment.