test: Added size button test

This commit is contained in:
Paul Valerie GOMA 2025-07-19 16:22:22 +02:00
parent 4b3804ca05
commit f3b93bb2b0

View File

@ -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)
})
})