Closed hxgqh closed 3 years ago
Hi,
Just ran it locally and it passes, as expected. Maybe your test is failing due to something else?
Closing as this doesn't look like a library issue. Feel free to reopen if it's not the case! :)
I am currently dealing with this issue.
const Component = {
template: `<button :disabled="disabled" @click="handleClick">Click Me</button>`,
props: ['disabled'],
methods: {
handleClick() {
this.$emit('save')
},
},
}
const { getByText, emitted, debug } = render(Component, {
props: {
disabled: true,
},
})
const saveButton = getByText('Click Me')
await fireEvent.click(saveButton)
expect(emitted('save').length).toBe(0)
The test is failing
Hi,
this is expected (albeit counterintuitive): https://github.com/testing-library/dom-testing-library/pull/217