feat(CountDown): add change event (#5599)
This commit is contained in:
@@ -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,
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user