diff --git a/src/material-experimental/mdc-core/option/optgroup.html b/src/material-experimental/mdc-core/option/optgroup.html index 62cd2edef2a9..bee46bd86361 100644 --- a/src/material-experimental/mdc-core/option/optgroup.html +++ b/src/material-experimental/mdc-core/option/optgroup.html @@ -1,8 +1,9 @@ - + diff --git a/src/material-experimental/mdc-select/select.spec.ts b/src/material-experimental/mdc-select/select.spec.ts index 208e77eb99d5..4cd8c3f9a64c 100644 --- a/src/material-experimental/mdc-select/select.spec.ts +++ b/src/material-experimental/mdc-select/select.spec.ts @@ -1133,7 +1133,7 @@ describe('MDC-based MatSelect', () => { it('should set the `aria-labelledby` attribute', fakeAsync(() => { let group = groups[0]; - let label = group.querySelector('label')!; + let label = group.querySelector('.mat-mdc-optgroup-label') as HTMLElement; expect(label.getAttribute('id')).toBeTruthy('Expected label to have an id.'); expect(group.getAttribute('aria-labelledby')) diff --git a/src/material/core/option/optgroup.html b/src/material/core/option/optgroup.html index 3789257f3869..c94670743485 100644 --- a/src/material/core/option/optgroup.html +++ b/src/material/core/option/optgroup.html @@ -1,2 +1,2 @@ - + diff --git a/src/material/select/select.spec.ts b/src/material/select/select.spec.ts index 2fc6a5c5d6de..a0076836e6c8 100644 --- a/src/material/select/select.spec.ts +++ b/src/material/select/select.spec.ts @@ -1129,7 +1129,7 @@ describe('MatSelect', () => { it('should set the `aria-labelledby` attribute', fakeAsync(() => { let group = groups[0]; - let label = group.querySelector('label')!; + let label = group.querySelector('span')!; expect(label.getAttribute('id')).toBeTruthy('Expected label to have an id.'); expect(group.getAttribute('aria-labelledby'))