Skip to content

Commit 5674c83

Browse files
crisbetojosephperrott
authored andcommitted
chore(datepicker): fix test failure (#9015)
1 parent 28943dd commit 5674c83

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib/datepicker/datepicker.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ describe('MatDatepicker', () => {
343343
expect(() => fixture.detectChanges()).not.toThrow();
344344
});
345345

346-
it('should clear out the backdrop subscriptions on close', () => {
346+
it('should clear out the backdrop subscriptions on close', fakeAsync(() => {
347347
for (let i = 0; i < 3; i++) {
348348
testComponent.datepicker.open();
349349
fixture.detectChanges();
@@ -361,10 +361,11 @@ describe('MatDatepicker', () => {
361361

362362
backdrop.click();
363363
fixture.detectChanges();
364+
flush();
364365

365366
expect(testComponent.datepicker.close).toHaveBeenCalledTimes(1);
366367
expect(testComponent.datepicker.opened).toBe(false);
367-
});
368+
}));
368369
});
369370

370371
describe('datepicker with too many inputs', () => {

0 commit comments

Comments
 (0)