visua-vue/test/VButton.spec.ts
2025-07-19 03:18:08 +02:00

19 lines
560 B
TypeScript

import { mount } from '@vue/test-utils'
import VButton from '@/components/button/VButton.vue'
import {test, expect, describe} from 'vitest'
describe('VButton', () => {
test('Displays button label', () => {
const wrapper = mount(VButton, {
props: {
label: 'button label',
title: 'button'
}
})
// Check that the props label has gone through
expect(wrapper.props('label')).toBe('button label')
// Checks that the rendering contains the expected value
expect(wrapper.text()).toContain('button label')
})
})