Add event listeners to vue component, fix #400

This commit is contained in:
Eric Fennis
2021-09-20 08:33:32 +02:00
parent 81ff3fc1d1
commit 06fe7d6a3f
2 changed files with 13 additions and 0 deletions

View File

@@ -41,4 +41,16 @@ describe('Using lucide icon components', () => {
expect(wrapper).toMatchSnapshot();
expect(wrapper.attributes('style')).toContain('position: absolute')
});
it('should call the onClick event', () => {
const onClick = jest.fn()
const wrapper = mount(Smile, {
listeners: {
click: onClick
}
})
wrapper.trigger('click')
expect(onClick).toHaveBeenCalled()
});
});