mirror of
https://github.com/vitest-dev/vitest.git
synced 2025-12-08 18:26:03 +00:00
24 lines
528 B
TypeScript
24 lines
528 B
TypeScript
import { mount } from '@vue/test-utils'
|
|
import Hello from '../src/components/Options.vue'
|
|
|
|
test('mount component', async () => {
|
|
expect(Hello).toBeTruthy()
|
|
|
|
const wrapper = mount(Hello, {
|
|
propsData: {
|
|
count: 4,
|
|
},
|
|
})
|
|
|
|
expect(wrapper.text()).toContain('4 x 2 = 8')
|
|
expect(wrapper.html()).toMatchSnapshot()
|
|
|
|
await wrapper.get('button').trigger('click')
|
|
|
|
expect(wrapper.text()).toContain('4 x 3 = 12')
|
|
|
|
await wrapper.get('button').trigger('click')
|
|
|
|
expect(wrapper.text()).toContain('4 x 4 = 16')
|
|
})
|