Skip to content

Commit 57e07e1

Browse files
crisbetojosephperrott
authored andcommitted
chore(datepicker): fix test failure (angular#9015)
1 parent 6cc9738 commit 57e07e1

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
@@ -341,7 +341,7 @@ describe('MatDatepicker', () => {
341341
expect(() => fixture.detectChanges()).not.toThrow();
342342
});
343343

344-
it('should clear out the backdrop subscriptions on close', () => {
344+
it('should clear out the backdrop subscriptions on close', fakeAsync(() => {
345345
for (let i = 0; i < 3; i++) {
346346
testComponent.datepicker.open();
347347
fixture.detectChanges();
@@ -359,10 +359,11 @@ describe('MatDatepicker', () => {
359359

360360
backdrop.click();
361361
fixture.detectChanges();
362+
flush();
362363

363364
expect(testComponent.datepicker.close).toHaveBeenCalledTimes(1);
364365
expect(testComponent.datepicker.opened).toBe(false);
365-
});
366+
}));
366367
});
367368

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

0 commit comments

Comments
 (0)