From f3b93bb2b0ea18dab289c3362a2d2bce8985b7b0 Mon Sep 17 00:00:00 2001 From: Paul Valerie GOMA Date: Sat, 19 Jul 2025 16:22:22 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20test:=20Added=20size=20button=20tes?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/VButton.spec.ts | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/test/VButton.spec.ts b/test/VButton.spec.ts index 425b83c..2f6208c 100644 --- a/test/VButton.spec.ts +++ b/test/VButton.spec.ts @@ -92,4 +92,45 @@ describe('VButton', () => { // check that the onClck function hasn't been called expect(onClick).not.toHaveBeenCalled() }) + + test('small button', () => { + const wrapper = mount(VButton, { + props: { + title: 'button', + label: 'label', + size: 'sm' + } + }) + const button = wrapper.find('button') + expect(button.classes()).toContain('p-button-sm') + expect(button.classes()).not.toContain('p-button-lg') + expect(button.classes().some(c => c.includes('text-body-SM'))).toBe(true) + }) + + test('large button', () => { + const wrapper = mount(VButton, { + props: { + title: 'button', + label: 'label', + size: 'lg' + } + }) + const button = wrapper.find('button') + expect(button.classes()).toContain('p-button-lg') + expect(button.classes()).not.toContain('p-button-sm') + expect(button.classes().some(c => c.includes('text-body-LG'))).toBe(true) + }) + + test('medium button', () => { + const wrapper = mount(VButton, { + props: { + title: 'button', + label: 'label', + } + }) + const button = wrapper.find('button') + expect(button.classes()).not.toContain('p-button-lg') + expect(button.classes()).not.toContain('p-button-sm') + expect(button.classes().some(c => c.includes('text-body-MD'))).toBe(true) + }) })