mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
feat(Skeleton): new component
This commit is contained in:
13
test/components/Skeleton.spec.ts
Normal file
13
test/components/Skeleton.spec.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import Skeleton, { type SkeletonProps } from '../../src/runtime/components/Skeleton.vue'
|
||||
import ComponentRender from '../component-render'
|
||||
|
||||
describe('Skeleton', () => {
|
||||
it.each([
|
||||
['basic case', {}],
|
||||
['with class', { props: { class: 'rounded-full size-12' } }]
|
||||
])('renders %s correctly', async (nameOrHtml: string, options: { props?: SkeletonProps, slots?: any }) => {
|
||||
const html = await ComponentRender(nameOrHtml, options, Skeleton)
|
||||
expect(html).toMatchSnapshot()
|
||||
})
|
||||
})
|
||||
5
test/components/__snapshots__/Skeleton.spec.ts.snap
Normal file
5
test/components/__snapshots__/Skeleton.spec.ts.snap
Normal file
@@ -0,0 +1,5 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`Skeleton > renders basic case correctly 1`] = `"<div class="animate-pulse rounded-md bg-gray-50 dark:bg-gray-800"></div>"`;
|
||||
|
||||
exports[`Skeleton > renders with class correctly 1`] = `"<div class="animate-pulse bg-gray-50 dark:bg-gray-800 rounded-full size-12"></div>"`;
|
||||
Reference in New Issue
Block a user