diff --git a/app/components/Settings/Toggle.client.vue b/app/components/Settings/Toggle.client.vue index 8d56de72c..90580d197 100644 --- a/app/components/Settings/Toggle.client.vue +++ b/app/components/Settings/Toggle.client.vue @@ -3,9 +3,8 @@ import TooltipApp from '~/components/Tooltip/App.vue' const props = withDefaults( defineProps<{ - label?: string + label: string description?: string - class?: string justify?: 'between' | 'start' tooltip?: string tooltipPosition?: 'top' | 'bottom' | 'left' | 'right' @@ -20,33 +19,31 @@ const props = withDefaults( ) const checked = defineModel({ - default: false, + required: true, }) +const id = useId() - +

{{ description }}

diff --git a/app/components/Settings/Toggle.server.vue b/app/components/Settings/Toggle.server.vue index 102a15c1c..b5f2105a1 100644 --- a/app/components/Settings/Toggle.server.vue +++ b/app/components/Settings/Toggle.server.vue @@ -1,18 +1,134 @@ + + diff --git a/test/nuxt/a11y.spec.ts b/test/nuxt/a11y.spec.ts index b67756378..84caccdd2 100644 --- a/test/nuxt/a11y.spec.ts +++ b/test/nuxt/a11y.spec.ts @@ -2400,7 +2400,7 @@ describe('component accessibility audits', () => { describe('Toggle', () => { it('should have no accessibility violations', async () => { const component = await mountSuspended(SettingsToggle, { - props: { label: 'Enable feature' }, + props: { label: 'Enable feature', modelValue: false }, }) const results = await runAxe(component) expect(results.violations).toEqual([]) @@ -2411,6 +2411,7 @@ describe('component accessibility audits', () => { props: { label: 'Enable feature', description: 'This enables the feature', + modelValue: false, }, }) const results = await runAxe(component) @@ -2548,7 +2549,7 @@ describe('background theme accessibility', () => { name: 'SettingsToggle', mount: () => mountSuspended(SettingsToggle, { - props: { label: 'Feature', description: 'Desc' }, + props: { label: 'Feature', description: 'Desc', modelValue: false }, }), }, {