Skip to content

Commit 6201764

Browse files
authored
test(material/datepicker): fix test failure (#20746)
A PR that changes the DOM structure of the datepicker went in at the same time as a PR that was depending on the old one, causing a test failure.
1 parent 54f36a3 commit 6201764

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/material/datepicker/datepicker.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2121,7 +2121,8 @@ describe('MatDatepicker', () => {
21212121
fixture.detectChanges();
21222122

21232123
const datepickerContent = testComponent.datepicker['_dialogRef']!!.componentInstance;
2124-
const actualClasses = datepickerContent._elementRef.nativeElement.children[1].classList;
2124+
const actualClasses =
2125+
datepickerContent._elementRef.nativeElement.querySelector('.mat-calendar').classList;
21252126
expect(actualClasses.contains('foo')).toBe(true);
21262127
expect(actualClasses.contains('bar')).toBe(true);
21272128
});

0 commit comments

Comments
 (0)