chore: sync with main

This commit is contained in:
Liam DeBeasi
2024-03-12 13:12:16 -04:00
7 changed files with 233 additions and 53 deletions

View File

@ -187,6 +187,7 @@ export class Checkbox implements ComponentInterface {
return (
<Host
aria-checked={indeterminate ? 'mixed' : `${checked}`}
class={createColorClasses(color, {
[mode]: true,
'in-item': hostContext('ion-item', el),

View File

@ -39,3 +39,18 @@ describe('ion-checkbox: disabled', () => {
expect(checkbox.checked).toBe(false);
});
});
describe('ion-checkbox: indeterminate', () => {
it('should have a mixed value for aria-checked', async () => {
const page = await newSpecPage({
components: [Checkbox],
html: `
<ion-checkbox indeterminate="true">Checkbox</ion-checkbox>
`,
});
const checkbox = page.body.querySelector('ion-checkbox')!;
expect(checkbox.getAttribute('aria-checked')).toBe('mixed');
});
});