mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-24 08:50:34 +01:00
test(Input): improve
This commit is contained in:
@@ -14,11 +14,10 @@ describe('Input', () => {
|
||||
['with icon', { props: { icon: 'i-heroicons-magnifying-glass' } }],
|
||||
['with leading and icon', { props: { leading: true, icon: 'i-heroicons-magnifying-glass' } }],
|
||||
['with leadingIcon', { props: { leadingIcon: 'i-heroicons-magnifying-glass' } }],
|
||||
['with loading icon', { props: { loading: true } }],
|
||||
['with leading slot', { slots: { leading: () => 'leading slot' } }],
|
||||
['with trailing and icon', { props: { trailing: true, icon: 'i-heroicons-magnifying-glass' } }],
|
||||
['with trailingIcon', { props: { trailingIcon: 'i-heroicons-magnifying-glass' } }],
|
||||
['with trailing slot', { slots: { leading: () => 'trailing slot' } }],
|
||||
['with loading', { props: { loading: true } }],
|
||||
['with loadingIcon', { props: { loading: true, loadingIcon: 'i-heroicons-sparkles' } }],
|
||||
['with size 2xs', { props: { size: '2xs' as const } }],
|
||||
['with size xs', { props: { size: 'xs' as const } }],
|
||||
['with size sm', { props: { size: 'sm' as const } }],
|
||||
@@ -26,7 +25,10 @@ describe('Input', () => {
|
||||
['with size lg', { props: { size: 'lg' as const } }],
|
||||
['with size xl', { props: { size: 'xl' as const } }],
|
||||
['with color', { props: { color: 'red' as const } }],
|
||||
['with variant', { props: { variant: 'outline' as const } }]
|
||||
['with variant', { props: { variant: 'outline' as const } }],
|
||||
['with default slot', { slots: { default: () => 'Default slot' } }],
|
||||
['with leading slot', { slots: { leading: () => 'Leading slot' } }],
|
||||
['with trailing slot', { slots: { trailing: () => 'Trailing slot' } }]
|
||||
])('renders %s correctly', async (nameOrHtml: string, options: { props?: InputProps, slots?: any }) => {
|
||||
const html = await ComponentRender(nameOrHtml, options, Input)
|
||||
expect(html).toMatchSnapshot()
|
||||
|
||||
Reference in New Issue
Block a user