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:
@@ -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');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user