fix(CountDown): should clear timer when destroyed (#4918)

This commit is contained in:
neverland
2019-11-04 20:16:03 +08:00
committed by GitHub
parent 577174c7f8
commit e0e597d164
2 changed files with 17 additions and 0 deletions
+13
View File
@@ -149,3 +149,16 @@ test('incomplate format prop', () => {
expect(wrapper).toMatchSnapshot();
});
test('pause when destroyed', async () => {
const pause = jest.fn();
const wrapper = mount(CountDown, {
mocks: {
pause
}
});
wrapper.destroy();
expect(wrapper.vm.counting).toBeFalsy();
});