first commit

This commit is contained in:
2025-04-22 10:56:56 +07:00
commit af123c091b
147 changed files with 778063 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import { describe, expect, it } from 'vitest'
import { mountSuspended } from '@nuxt/test-utils/runtime'
import DialogConfirm from '~/components/DialogConfirm.vue'
import { VCard } from 'vuetify/components'
describe('component DialogConfirm.vue', () => {
it('should not open', async () => {
const wrapper = await mountSuspended(DialogConfirm)
expect(wrapper.html()).toMatchInlineSnapshot(`""`)
})
it('should open and close', async () => {
const wrapper = await mountSuspended(DialogConfirm)
wrapper.vm.open('message')
await nextTick()
const cardWrapper = wrapper.getComponent(VCard)
expect(cardWrapper.text()).toContain('message')
expect(cardWrapper.html()).toMatchSnapshot()
expect(cardWrapper.find('button').exists()).toBe(true)
await cardWrapper.find('button').trigger('click')
expect(cardWrapper.isVisible()).toBe(false)
})
})