mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-24 00:40:34 +01:00
test: lint
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { describe, it, expect, test } from 'vitest'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import Textarea, { type TextareaProps } from '../../src/runtime/components/Textarea.vue'
|
||||
import ComponentRender from '../component-render'
|
||||
import { mount } from '@vue/test-utils'
|
||||
|
||||
describe('Textarea', () => {
|
||||
it.each([
|
||||
@@ -12,26 +12,25 @@ describe('Textarea', () => {
|
||||
['with required', { props: { required: true } }],
|
||||
['with disabled', { props: { disabled: true } }],
|
||||
['with rows', { props: { rows: 5 } }],
|
||||
['with size', { props: { size: 'sm' } }],
|
||||
['with color', { props: { color: 'blue' } }],
|
||||
['with size', { props: { size: 'sm' as const } }],
|
||||
['with color', { props: { color: 'blue' as const } }],
|
||||
['with size 2xs', { props: { size: '2xs' as const } }],
|
||||
['with size xs', { props: { size: 'xs' as const } }],
|
||||
['with size sm', { props: { size: 'sm' as const } }],
|
||||
['with size md', { props: { size: 'md' as const } }],
|
||||
['with size lg', { props: { size: 'lg' as const } }],
|
||||
['with size xl', { props: { size: 'xl' as const } }],
|
||||
['with variant', { variant: 'outline' }],
|
||||
['with variant', { props: { variant: 'outline' as const } }],
|
||||
['with default slot', { slots: { default: () => 'Default slot' } }]
|
||||
// @ts-ignore
|
||||
])('renders %s correctly', async (nameOrHtml: string, options: { props: TextareaProps, slots?: any }) => {
|
||||
])('renders %s correctly', async (nameOrHtml: string, options: { props?: TextareaProps, slots?: any }) => {
|
||||
const html = await ComponentRender(nameOrHtml, options, Textarea)
|
||||
expect(html).toMatchSnapshot()
|
||||
})
|
||||
|
||||
it.each([
|
||||
['with .trim modifier', { props: { modelModifiers: { trim: true } } }, { input: 'input ', expected: 'input' } ],
|
||||
['with .number modifier', { props: { modelModifiers: { number: true } } }, { input: '42', expected: 42 } ],
|
||||
['with .lazy modifier', { props: { modelModifiers: { lazy: true } } }, { input: 'input', expected: 'input' } ]
|
||||
['with .trim modifier', { props: { modelModifiers: { trim: true } } }, { input: 'input ', expected: 'input' }],
|
||||
['with .number modifier', { props: { modelModifiers: { number: true } } }, { input: '42', expected: 42 }],
|
||||
['with .lazy modifier', { props: { modelModifiers: { lazy: true } } }, { input: 'input', expected: 'input' }]
|
||||
])('%s works', async (_nameOrHtml: string, options: { props?: any, slots?: any }, spec: { input: any, expected: any }) => {
|
||||
const wrapper = await mount(Textarea, {
|
||||
...options
|
||||
|
||||
Reference in New Issue
Block a user