📅  最后修改于: 2022-03-11 14:55:22.895000             🧑  作者: Mango
const div = document.createElement('div')
div.id = 'root'
document.body.appendChild(div)
it('button click triggers submit event', () => {
const wrapper = shallowMount(Form, {
attachTo: '#root'
})
wrapper.find("[type='submit']").trigger('click')
assert.exists(
wrapper.emitted('submitEventTriggered'),
'Form submit not triggered'
)
})