diff --git a/src/runtime/components/Slider.vue b/src/runtime/components/Slider.vue index 94ad0ede26..5a78367d7f 100644 --- a/src/runtime/components/Slider.vue +++ b/src/runtime/components/Slider.vue @@ -111,7 +111,7 @@ function onChange(value: any) { diff --git a/test/components/FormField.spec.ts b/test/components/FormField.spec.ts index 002a61f371..88a47a12a7 100644 --- a/test/components/FormField.spec.ts +++ b/test/components/FormField.spec.ts @@ -132,6 +132,20 @@ describe('FormField', () => { }) } + if (name === 'Slider') { + test('binds aria attributes on the thumb', async () => { + const wrapper = await renderFormField({ + props: { error: 'Error' }, + inputComponent + }) + + const invalid = wrapper.findAll('[aria-invalid="true"]') + expect(invalid).toHaveLength(1) + expect(invalid[0]!.attributes('role')).toBe('slider') + expect(invalid[0]!.attributes('aria-describedby')).toBe('v-0-0-error') + }) + } + test('binds hints with aria-describedby', async () => { const wrapper = await renderFormField({ props: { hint: 'somehint' },