✅ test: Added onClick function button test
This commit is contained in:
parent
cf4eee75b0
commit
60cdf35007
|
@ -93,6 +93,21 @@ describe('VButton', () => {
|
||||||
expect(onClick).not.toHaveBeenCalled()
|
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', () => {
|
test('small button', () => {
|
||||||
const wrapper = mount(VButton, {
|
const wrapper = mount(VButton, {
|
||||||
props: {
|
props: {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user