2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-21 21:00:38 +03:00

feat: add event panel-change

This commit is contained in:
mengxiong10
2020-11-17 17:41:59 +08:00
parent 45969a1480
commit 3d29b49de0
4 changed files with 15 additions and 0 deletions
+11
View File
@@ -439,4 +439,15 @@ describe('DatePicker', () => {
expect(wrapper.emitted().input[1]).toBe(undefined);
expect(wrapper.emitted()['input-error'][0][0]).toBe('2020-05-01');
});
it('panel-change event should be emitd', async () => {
wrapper = mount(DatePicker, {
propsData: {
open: true,
},
});
const yearBtn = wrapper.find('.mx-btn-current-year');
await yearBtn.trigger('click');
expect(wrapper.emitted()['panel-change'][0]).toEqual(['year', 'date']);
});
});