test: Added onClick function button test

This commit is contained in:
Paul Valerie GOMA 2025-07-21 09:32:21 +02:00
parent cf4eee75b0
commit 60cdf35007

View File

@ -93,6 +93,21 @@ describe('VButton', () => {
expect(onClick).not.toHaveBeenCalled()
})
test('Clicked button', async () => {
const onClick = vi.fn()
const wrapper = mount(VButton, {
props: {
title: 'button',
label: 'label',
onClick,
}
})
const button = wrapper.find('button')
await button.trigger('click')
// check that the onClck function has been called
expect(onClick).toHaveBeenCalled()
})
test('small button', () => {
const wrapper = mount(VButton, {
props: {