diff --git a/stencil-workspace/src/components/modus-switch/modus-switch.e2e.ts b/stencil-workspace/src/components/modus-switch/modus-switch.e2e.ts index 6dc779100..99ac99d04 100644 --- a/stencil-workspace/src/components/modus-switch/modus-switch.e2e.ts +++ b/stencil-workspace/src/components/modus-switch/modus-switch.e2e.ts @@ -94,12 +94,14 @@ describe('modus-switch', () => { const input = await page.find('modus-switch >>> input'); expect(await modusSwitch.getProperty('checked')).toBeTruthy(); expect(await input.getProperty('checked')).toBeTruthy(); + expect(await input.getAttribute('aria-checked').toLowerCase()).toEqual('true'); await element.click(); await page.waitForChanges(); expect(await modusSwitch.getProperty('checked')).toBeFalsy(); expect(await input.getProperty('checked')).toBeFalsy(); + expect(await input.getAttribute('aria-checked').toLowerCase()).toEqual('false'); }); it('renders with medium size', async () => { const page = await newE2EPage(); diff --git a/stencil-workspace/src/components/modus-switch/modus-switch.spec.tsx b/stencil-workspace/src/components/modus-switch/modus-switch.spec.tsx index 3f7eb8a11..7beba3317 100644 --- a/stencil-workspace/src/components/modus-switch/modus-switch.spec.tsx +++ b/stencil-workspace/src/components/modus-switch/modus-switch.spec.tsx @@ -14,7 +14,7 @@ describe('modus-switch', () => {
- + @@ -33,7 +33,7 @@ describe('modus-switch', () => {
- + diff --git a/stencil-workspace/src/components/modus-switch/modus-switch.tsx b/stencil-workspace/src/components/modus-switch/modus-switch.tsx index fbbf925f2..17b0042b3 100644 --- a/stencil-workspace/src/components/modus-switch/modus-switch.tsx +++ b/stencil-workspace/src/components/modus-switch/modus-switch.tsx @@ -11,7 +11,7 @@ export class ModusSwitch { @Prop() ariaLabel: string | null; /** (optional) Whether the switch is checked. */ - @Prop({ mutable: true }) checked: boolean; + @Prop({ mutable: true }) checked = false; /** (optional) Whether the switch is disabled. */ @Prop() disabled: boolean; @@ -69,7 +69,7 @@ export class ModusSwitch {