test(Table): import from #components to resolve components

This commit is contained in:
Benjamin Canac
2024-10-24 16:27:39 +02:00
parent 058c49add2
commit 3f48fdae8d
2 changed files with 94 additions and 41 deletions

View File

@@ -1,5 +1,6 @@
import { h, resolveComponent } from 'vue'
import { h } from 'vue'
import { describe, it, expect } from 'vitest'
import { UCheckbox, UButton, UBadge, UDropdownMenu } from '#components'
import Table, { type TableProps, type TableSlots, type TableColumn } from '../../src/runtime/components/Table.vue'
import ComponentRender from '../component-render'
import theme from '#build/ui/table'
@@ -8,11 +9,6 @@ describe('Table', () => {
const loadingColors = Object.keys(theme.variants.loadingColor) as any
const loadingAnimations = Object.keys(theme.variants.loadingAnimation) as any
const UButton = resolveComponent('UButton')
const UCheckbox = resolveComponent('UCheckbox')
const UBadge = resolveComponent('UBadge')
const UDropdownMenu = resolveComponent('UDropdownMenu')
const data = [{
id: 'm5gr84i9',
amount: 316,
@@ -130,7 +126,7 @@ describe('Table', () => {
label: 'View payment details'
}]
return h('div', { class: 'text-right' }, h(UDropdownMenu, {
return h('div', { class: 'text-right' }, h<any>(UDropdownMenu, {
content: {
align: 'end'
},