Skip to content

Commit

Permalink
Failing test – clear timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
bruceharris committed Dec 6, 2017
1 parent 3b44540 commit 47dfd91
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 @@ -47,4 +47,18 @@ describe('LoadingIndicator', () => {
});
});
});

describe('on unmount', () => {
it('should clear timeout', () => {
jest.useFakeTimers();
const wrapper = mount(
<LoadingIndicator isLoading={true}>
<div>ahoy!</div>
</LoadingIndicator>
);

wrapper.unmount();
expect(clearTimeout.mock.calls.length).toEqual(1);
});
});
});

0 comments on commit 47dfd91

Please sign in to comment.