feat(CountDown): add change event (#5599)

This commit is contained in:
陈嘉涵
2020-01-23 10:22:15 +08:00
parent b83bed3b6c
commit 1404c82dba
4 changed files with 21 additions and 0 deletions
+18
View File
@@ -213,3 +213,21 @@ test('pause when deactivated', async () => {
wrapper.setData({ render: true });
expect(countDown.counting).toBeFalsy();
});
test('change event', async () => {
const wrapper = mount(CountDown, {
propsData: {
time: 1,
},
});
expect(wrapper.emitted('change')).toBeFalsy();
await later(50);
expect(wrapper.emitted('change')[0][0]).toEqual({
days: 0,
hours: 0,
milliseconds: 0,
minutes: 0,
seconds: 0,
});
});