From 60cdf35007c83c3312f6e3c50319c9169a4f4b0d Mon Sep 17 00:00:00 2001 From: Paul Valerie GOMA Date: Mon, 21 Jul 2025 09:32:21 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20test:=20Added=20onClick=20function?= =?UTF-8?q?=20button=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/VButton.spec.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/VButton.spec.ts b/test/VButton.spec.ts index d0cc48f..c0c1974 100644 --- a/test/VButton.spec.ts +++ b/test/VButton.spec.ts @@ -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: {