test(Avatar): update

This commit is contained in:
Benjamin Canac
2024-03-11 15:43:44 +01:00
parent 78fc16aa18
commit 924551e546
2 changed files with 10 additions and 1 deletions

View File

@@ -6,7 +6,9 @@ describe('Avatar', () => {
it.each([
['with src', { props: { src: 'https://avatars.githubusercontent.com/u/739984?v=4' } }],
['with alt', { props: { alt: 'Benjamin Canac' } }],
['with class', { props: { class: 'bg-white dark:bg-gray-900' } }],
['with fallback', { props: { fallback: '+1' } }],
['with icon', { props: { icon: 'i-heroicons-photo' } }],
['with size 3xs', { props: { size: '3xs' as const } }],
['with size 2xs', { props: { size: '2xs' as const } }],
['with size xs', { props: { size: 'xs' as const } }],
@@ -15,7 +17,8 @@ describe('Avatar', () => {
['with size lg', { props: { size: 'lg' as const } }],
['with size xl', { props: { size: 'xl' as const } }],
['with size 2xl', { props: { size: '2xl' as const } }],
['with size 3xl', { props: { size: '3xl' as const } }]
['with size 3xl', { props: { size: '3xl' as const } }],
['with ui', { props: { ui: { fallback: 'font-bold' } } }]
])('renders %s correctly', async (nameOrHtml: string, options: { props?: AvatarProps, slots?: any }) => {
const html = await ComponentRender(nameOrHtml, options, Avatar)
expect(html).toMatchSnapshot()