Skip to content

Commit f9dca40

Browse files
committed
update specs
1 parent a77d2ea commit f9dca40

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/material/chips/chip-grid.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,10 @@ describe('MatChipGrid', () => {
983983
errorTestComponent.formControl.markAsTouched();
984984
fixture.detectChanges();
985985

986-
expect(containerEl.querySelector('mat-error')!.getAttribute('aria-live')).toBe('polite');
986+
expect(
987+
containerEl.querySelector('[aria-live]:has(mat-error)')!.getAttribute('aria-live'),
988+
).toBe('polite');
989+
});
987990
});
988991

989992
it('sets the aria-describedby on the input to reference errors when in error state', fakeAsync(() => {

src/material/input/input.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,11 +1266,13 @@ describe('MatMdcInput with forms', () => {
12661266
.toBe(1);
12671267
}));
12681268

1269-
it('should set the proper aria-live attribute on the error messages', fakeAsync(() => {
1269+
it('should be in a parent element with the an aria-live attribute to announce the error', fakeAsync(() => {
12701270
testComponent.formControl.markAsTouched();
12711271
fixture.detectChanges();
12721272

1273-
expect(containerEl.querySelector('mat-error')!.getAttribute('aria-live')).toBe('polite');
1273+
expect(
1274+
containerEl.querySelector('[aria-live]:has(mat-error)')!.getAttribute('aria-live'),
1275+
).toBe('polite');
12741276
}));
12751277

12761278
it('sets the aria-describedby to reference errors when in error state', fakeAsync(() => {

0 commit comments

Comments
 (0)