mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-24 17:00:36 +01:00
fix(FormField): resolve minor accessibility and rendering issues (#4515)
Co-authored-by: Romain Hamel <rom.hml@gmail.com>
This commit is contained in:
@@ -157,5 +157,25 @@ describe('FormField', () => {
|
||||
const attr = wrapper.find('[aria-invalid=true]')
|
||||
expect(attr.exists()).toBe(true)
|
||||
})
|
||||
|
||||
test('renders id for aria describedby when help prop is provided', async () => {
|
||||
const wrapper = await renderFormField({
|
||||
props: { help: 'somehelp' },
|
||||
inputComponent
|
||||
})
|
||||
|
||||
const attr = wrapper.find('[id=v-0-0-help]')
|
||||
expect(attr.exists()).toBe(true)
|
||||
})
|
||||
|
||||
test('renders no id for aria describedby when no help prop is provided', async () => {
|
||||
const wrapper = await renderFormField({
|
||||
props: { label: 'Username', description: 'Enter your username' },
|
||||
inputComponent
|
||||
})
|
||||
|
||||
const attr = wrapper.find('[id=v-0-0-help]')
|
||||
expect(attr.exists()).toBe(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user