From 959b1295f2ea77e49314863402649e0aabae31a9 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Wed, 13 Mar 2024 12:27:10 +0100 Subject: [PATCH] test: update --- test/components/Badge.spec.ts | 1 + test/components/Card.spec.ts | 2 ++ test/components/Kbd.spec.ts | 1 + test/components/Skeleton.spec.ts | 1 + test/components/__snapshots__/Badge.spec.ts.snap | 2 ++ test/components/__snapshots__/Card.spec.ts.snap | 16 ++++++++++++++++ test/components/__snapshots__/Kbd.spec.ts.snap | 2 ++ .../__snapshots__/Skeleton.spec.ts.snap | 2 ++ 8 files changed, 27 insertions(+) diff --git a/test/components/Badge.spec.ts b/test/components/Badge.spec.ts index 017d7910..727de921 100644 --- a/test/components/Badge.spec.ts +++ b/test/components/Badge.spec.ts @@ -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 } }], diff --git a/test/components/Card.spec.ts b/test/components/Card.spec.ts index 9116075f..a2092dd4 100644 --- a/test/components/Card.spec.ts +++ b/test/components/Card.spec.ts @@ -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' } }] diff --git a/test/components/Kbd.spec.ts b/test/components/Kbd.spec.ts index c4e877fe..6487db9d 100644 --- a/test/components/Kbd.spec.ts +++ b/test/components/Kbd.spec.ts @@ -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 } }], diff --git a/test/components/Skeleton.spec.ts b/test/components/Skeleton.spec.ts index 91adcf45..4e8d3ce4 100644 --- a/test/components/Skeleton.spec.ts +++ b/test/components/Skeleton.spec.ts @@ -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) diff --git a/test/components/__snapshots__/Badge.spec.ts.snap b/test/components/__snapshots__/Badge.spec.ts.snap index 9b752dce..e51ed7ea 100644 --- a/test/components/__snapshots__/Badge.spec.ts.snap +++ b/test/components/__snapshots__/Badge.spec.ts.snap @@ -1,5 +1,7 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html +exports[`Badge > renders with as correctly 1`] = `"
Badge
"`; + exports[`Badge > renders with class correctly 1`] = `"Badge"`; exports[`Badge > renders with color black correctly 1`] = `"Badge"`; diff --git a/test/components/__snapshots__/Card.spec.ts.snap b/test/components/__snapshots__/Card.spec.ts.snap index d52f51f9..1c333dff 100644 --- a/test/components/__snapshots__/Card.spec.ts.snap +++ b/test/components/__snapshots__/Card.spec.ts.snap @@ -8,6 +8,22 @@ exports[`Card > renders basic case correctly 1`] = ` " `; +exports[`Card > renders with as correctly 1`] = ` +"
+ + + +
" +`; + +exports[`Card > renders with class correctly 1`] = ` +"
+ + + +
" +`; + exports[`Card > renders with default slot correctly 1`] = ` "
diff --git a/test/components/__snapshots__/Kbd.spec.ts.snap b/test/components/__snapshots__/Kbd.spec.ts.snap index 19e0a17c..2eaca1dd 100644 --- a/test/components/__snapshots__/Kbd.spec.ts.snap +++ b/test/components/__snapshots__/Kbd.spec.ts.snap @@ -1,5 +1,7 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html +exports[`Kbd > renders with as correctly 1`] = `"K"`; + exports[`Kbd > renders with class correctly 1`] = `"K"`; exports[`Kbd > renders with default slot correctly 1`] = `"Default slot"`; diff --git a/test/components/__snapshots__/Skeleton.spec.ts.snap b/test/components/__snapshots__/Skeleton.spec.ts.snap index 2014e5b8..54c259d9 100644 --- a/test/components/__snapshots__/Skeleton.spec.ts.snap +++ b/test/components/__snapshots__/Skeleton.spec.ts.snap @@ -2,4 +2,6 @@ exports[`Skeleton > renders basic case correctly 1`] = `"
"`; +exports[`Skeleton > renders with as correctly 1`] = `""`; + exports[`Skeleton > renders with class correctly 1`] = `"
"`;