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

fix: prevent button triggering external form submit (#389)

This commit is contained in:
mengxiong10
2019-12-04 16:25:48 +08:00
parent 0e43746b5f
commit 7fcc1df67c
4 changed files with 40 additions and 1 deletions
+14
View File
@@ -325,4 +325,18 @@ describe('DatePicker', () => {
el.trigger('click');
expect(wrapper.emitted().close).toBeTruthy();
});
// present the button submit form
it('the type of all buttons should be button', () => {
wrapper = mount(DatePicker, {
propsData: {
open: true,
showTimePanel: true,
},
});
const els = wrapper.findAll('button');
els.wrappers.forEach(v => {
expect(v.element.type).toBe('button');
});
});
});