Skip to content

Commit

Permalink
chore: add test (#1441)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiller1990 committed Apr 19, 2022
1 parent 7059cff commit 7b8d0a3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/trigger.spec.ts
Expand Up @@ -345,4 +345,22 @@ describe('trigger', () => {
expect(clickHandler).not.toHaveBeenCalled()
})
})

it('dispatches event', async () => {
const Comp = defineComponent({
template: `
<input
@keyup.enter="$emit('enter')"
@keyup.esc="$emit('esc')"
@click="$emit('click')"
>
`
})

const wrapper = mount(Comp)

await wrapper.find('input').trigger('keyup.enter')

expect(wrapper.emitted().enter).toHaveLength(1)
})
})

0 comments on commit 7b8d0a3

Please sign in to comment.