20 lines
406 B
JavaScript
20 lines
406 B
JavaScript
import {mount} from '@vue/test-utils'
|
|
import {expect, test} from 'vitest'
|
|
|
|
// The component to test
|
|
const MessageComponent = {
|
|
template: '<p>{{ msg }}</p>',
|
|
props: ['msg']
|
|
}
|
|
|
|
test('displays message', () => {
|
|
const wrapper = mount(MessageComponent, {
|
|
props: {
|
|
msg: 'Hello world'
|
|
}
|
|
})
|
|
|
|
// Assert the rendered text of the component
|
|
expect(wrapper.text()).toContain('Hello world')
|
|
})
|