test: add frontend tests for vue components

This commit is contained in:
dni ⚡
2025-12-23 10:58:46 +01:00
parent 8e0d1cc100
commit b2aaf97cf3
7 changed files with 2705 additions and 4 deletions
+19
View File
@@ -0,0 +1,19 @@
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')
})