Skip to content

Commit 4e34087

Browse files
committed
test: add tick() to wait for setTimeout in timepicker test
1 parent 8b33356 commit 4e34087

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/material/timepicker/timepicker.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Component, Injector, Provider, signal, ViewChild, ViewEncapsulation} from '@angular/core';
2-
import {ComponentFixture, fakeAsync, flush, TestBed} from '@angular/core/testing';
2+
import {ComponentFixture, fakeAsync, flush, TestBed, tick} from '@angular/core/testing';
33
import {DateAdapter, MATERIAL_ANIMATIONS, provideNativeDateAdapter} from '../core';
44
import {
55
clearElement,
@@ -161,6 +161,7 @@ describe('MatTimepicker', () => {
161161
fixture.detectChanges();
162162
getOptions()[3].click(); // Select 1:30 AM
163163
fixture.detectChanges();
164+
tick(); // Wait for setTimeout(0) to complete
164165
flush();
165166

166167
expect(formControlValue).toBeTruthy();

0 commit comments

Comments
 (0)