mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
up
This commit is contained in:
@@ -120,7 +120,7 @@ describe('CheckboxGroup', () => {
|
||||
test('no label for=... on FormField', async () => {
|
||||
const { wrapper } = await createForm()
|
||||
const formFieldLabel = wrapper.findAll('label').map(label => label.attributes()).filter(label => !label.for?.includes(':'))[0]
|
||||
expect(formFieldLabel.for).toBeUndefined()
|
||||
expect(formFieldLabel?.for).toBeUndefined()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -68,15 +68,15 @@ describe('CommandPalette', () => {
|
||||
// Props
|
||||
['with groups', { props }],
|
||||
['without data', {}],
|
||||
['with modelValue', { props: { ...props, modelValue: groups[2].items[0] } }],
|
||||
['with defaultValue', { props: { ...props, defaultValue: groups[2].items[0] } }],
|
||||
['with modelValue', { props: { ...props, modelValue: groups[2]?.items[0] } }],
|
||||
['with defaultValue', { props: { ...props, defaultValue: groups[2]?.items[0] } }],
|
||||
['with labelKey', { props: { ...props, labelKey: 'icon' } }],
|
||||
['with placeholder', { props: { ...props, placeholder: 'Search...' } }],
|
||||
['with disabled', { props: { ...props, disabled: true } }],
|
||||
['with icon', { props: { ...props, icon: 'i-lucide-terminal' } }],
|
||||
['with loading', { props: { ...props, loading: true } }],
|
||||
['with loadingIcon', { props: { ...props, loading: true, loadingIcon: 'i-lucide-loader' } }],
|
||||
['with selectedIcon', { props: { ...props, selectedIcon: 'i-lucide-badge-check', modelValue: groups[2].items[0] } }],
|
||||
['with selectedIcon', { props: { ...props, selectedIcon: 'i-lucide-badge-check', modelValue: groups[2]?.items[0] } }],
|
||||
['with close', { props: { ...props, close: true } }],
|
||||
['with closeIcon', { props: { ...props, close: true, closeIcon: 'i-lucide-trash' } }],
|
||||
['with as', { props: { ...props, as: 'section' } }],
|
||||
|
||||
@@ -314,8 +314,8 @@ describe('Form', () => {
|
||||
emailInput.trigger('focus')
|
||||
await flushPromises()
|
||||
expect(mockWatchCallback).toHaveBeenCalledTimes(1)
|
||||
expect(mockWatchCallback.mock.calls[0][0].has('email')).toBe(true)
|
||||
expect(mockWatchCallback.mock.calls[0][0].has('password')).toBe(false)
|
||||
expect(mockWatchCallback.mock.calls?.[0]?.[0]?.has('email')).toBe(true)
|
||||
expect(mockWatchCallback.mock.calls?.[0]?.[0]?.has('password')).toBe(false)
|
||||
})
|
||||
|
||||
test('reactivity: touchedFields works on change', async () => {
|
||||
@@ -327,8 +327,8 @@ describe('Form', () => {
|
||||
emailInput.trigger('change')
|
||||
await flushPromises()
|
||||
expect(mockWatchCallback).toHaveBeenCalledTimes(1)
|
||||
expect(mockWatchCallback.mock.calls[0][0].has('email')).toBe(true)
|
||||
expect(mockWatchCallback.mock.calls[0][0].has('password')).toBe(false)
|
||||
expect(mockWatchCallback.mock.calls?.[0]?.[0]?.has('email')).toBe(true)
|
||||
expect(mockWatchCallback.mock.calls?.[0]?.[0]?.has('password')).toBe(false)
|
||||
})
|
||||
|
||||
test('reactivity: blurredFields works', async () => {
|
||||
@@ -340,8 +340,8 @@ describe('Form', () => {
|
||||
emailInput.trigger('blur')
|
||||
await flushPromises()
|
||||
expect(mockWatchCallback).toHaveBeenCalledTimes(1)
|
||||
expect(mockWatchCallback.mock.calls[0][0].has('email')).toBe(true)
|
||||
expect(mockWatchCallback.mock.calls[0][0].has('password')).toBe(false)
|
||||
expect(mockWatchCallback.mock.calls?.[0]?.[0]?.has('email')).toBe(true)
|
||||
expect(mockWatchCallback.mock.calls?.[0]?.[0]?.has('password')).toBe(false)
|
||||
})
|
||||
|
||||
test('reactivity: dirtyFields works', async () => {
|
||||
@@ -352,8 +352,8 @@ describe('Form', () => {
|
||||
emailInput.trigger('change')
|
||||
await flushPromises()
|
||||
expect(mockWatchCallback).toHaveBeenCalledTimes(1)
|
||||
expect(mockWatchCallback.mock.calls[0][0].has('email')).toBe(true)
|
||||
expect(mockWatchCallback.mock.calls[0][0].has('password')).toBe(false)
|
||||
expect(mockWatchCallback.mock.calls?.[0]?.[0]?.has('email')).toBe(true)
|
||||
expect(mockWatchCallback.mock.calls?.[0]?.[0]?.has('password')).toBe(false)
|
||||
})
|
||||
|
||||
test('reactivity: dirty works', async () => {
|
||||
|
||||
@@ -122,7 +122,7 @@ describe('RadioGroup', () => {
|
||||
test('no label for=... on FormField', async () => {
|
||||
const { wrapper } = await createForm()
|
||||
const formFieldLabel = wrapper.findAll('label').map(label => label.attributes()).filter(label => !label.for?.includes('Option'))[0]
|
||||
expect(formFieldLabel.for).toBeUndefined()
|
||||
expect(formFieldLabel?.for).toBeUndefined()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user