mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
test: update
This commit is contained in:
@@ -5,6 +5,7 @@ import ComponentRender from '../component-render'
|
||||
describe('Badge', () => {
|
||||
it.each([
|
||||
['with label', { props: { label: 'Badge' } }],
|
||||
['with as', { props: { label: 'Badge', as: 'div' } }],
|
||||
['with class', { props: { label: 'Badge', class: 'rounded-full font-bold' } }],
|
||||
['with size xs', { props: { label: 'Badge', size: 'xs' as const } }],
|
||||
['with size sm', { props: { label: 'Badge', size: 'sm' as const } }],
|
||||
|
||||
@@ -5,6 +5,8 @@ import ComponentRender from '../component-render'
|
||||
describe('Card', () => {
|
||||
it.each([
|
||||
['basic case', {}],
|
||||
['with as', { props: { as: 'section' } }],
|
||||
['with class', { props: { class: 'rounded-xl' } }],
|
||||
['with default slot', { slots: { default: () => 'Default slot' } }],
|
||||
['with header slot', { slots: { header: () => 'Header slot' } }],
|
||||
['with footer slot', { slots: { footer: () => 'Footer slot' } }]
|
||||
|
||||
@@ -5,6 +5,7 @@ import ComponentRender from '../component-render'
|
||||
describe('Kbd', () => {
|
||||
it.each([
|
||||
['with value', { props: { value: 'K' } }],
|
||||
['with as', { props: { value: 'K', as: 'span' } }],
|
||||
['with class', { props: { value: 'K', class: 'font-bold' } }],
|
||||
['with size xs', { props: { value: 'K', size: 'xs' as const } }],
|
||||
['with size sm', { props: { value: 'K', size: 'sm' as const } }],
|
||||
|
||||
@@ -5,6 +5,7 @@ import ComponentRender from '../component-render'
|
||||
describe('Skeleton', () => {
|
||||
it.each([
|
||||
['basic case', {}],
|
||||
['with as', { props: { as: 'span' } }],
|
||||
['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)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`Badge > renders with as correctly 1`] = `"<div class="rounded-md font-medium inline-flex items-center text-xs px-2 py-1 bg-primary-500 dark:bg-primary-400 text-white dark:text-gray-900">Badge</div>"`;
|
||||
|
||||
exports[`Badge > renders with class correctly 1`] = `"<span class="inline-flex items-center text-xs px-2 py-1 bg-primary-500 dark:bg-primary-400 text-white dark:text-gray-900 rounded-full font-bold">Badge</span>"`;
|
||||
|
||||
exports[`Badge > renders with color black correctly 1`] = `"<span class="rounded-md font-medium inline-flex items-center text-xs px-2 py-1 text-white dark:text-gray-900 bg-gray-900 dark:bg-white">Badge</span>"`;
|
||||
|
||||
@@ -8,6 +8,22 @@ exports[`Card > renders basic case correctly 1`] = `
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`Card > renders with as correctly 1`] = `
|
||||
"<section class="bg-white dark:bg-gray-900 ring ring-gray-200 dark:ring-gray-800 rounded-lg shadow">
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</section>"
|
||||
`;
|
||||
|
||||
exports[`Card > renders with class correctly 1`] = `
|
||||
"<div class="bg-white dark:bg-gray-900 ring ring-gray-200 dark:ring-gray-800 shadow rounded-xl">
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`Card > renders with default slot correctly 1`] = `
|
||||
"<div class="bg-white dark:bg-gray-900 ring ring-gray-200 dark:ring-gray-800 rounded-lg shadow">
|
||||
<!--v-if-->
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`Kbd > renders with as correctly 1`] = `"<span class="inline-flex items-center justify-center text-gray-900 dark:text-white px-1 rounded font-medium font-sans bg-gray-50 dark:bg-gray-800 ring ring-gray-300 dark:ring-gray-700 ring-inset h-5 min-w-[20px] text-[11px]">K</span>"`;
|
||||
|
||||
exports[`Kbd > renders with class correctly 1`] = `"<kbd class="inline-flex items-center justify-center text-gray-900 dark:text-white px-1 rounded font-sans bg-gray-50 dark:bg-gray-800 ring ring-gray-300 dark:ring-gray-700 ring-inset h-5 min-w-[20px] text-[11px] font-bold">K</kbd>"`;
|
||||
|
||||
exports[`Kbd > renders with default slot correctly 1`] = `"<kbd class="inline-flex items-center justify-center text-gray-900 dark:text-white px-1 rounded font-medium font-sans bg-gray-50 dark:bg-gray-800 ring ring-gray-300 dark:ring-gray-700 ring-inset h-5 min-w-[20px] text-[11px]">Default slot</kbd>"`;
|
||||
|
||||
@@ -2,4 +2,6 @@
|
||||
|
||||
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 as correctly 1`] = `"<span class="animate-pulse rounded-md bg-gray-50 dark:bg-gray-800"></span>"`;
|
||||
|
||||
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