@@ -46,7 +46,6 @@ describe('MatTimepicker', () => {
46
46
47
47
getOptions ( ) [ 3 ] . click ( ) ;
48
48
fixture . detectChanges ( ) ;
49
- flushMicrotasks ( ) ;
50
49
flush ( ) ;
51
50
52
51
const value = fixture . componentInstance . input . value ( ) ! ;
@@ -72,7 +71,6 @@ describe('MatTimepicker', () => {
72
71
73
72
getOptions ( ) [ 1 ] . click ( ) ;
74
73
fixture . detectChanges ( ) ;
75
- flushMicrotasks ( ) ;
76
74
flush ( ) ;
77
75
78
76
expect ( getPanel ( ) ) . toBeFalsy ( ) ;
@@ -126,7 +124,6 @@ describe('MatTimepicker', () => {
126
124
127
125
getOptions ( ) [ getActiveOptionIndex ( ) ] . click ( ) ;
128
126
fixture . detectChanges ( ) ;
129
- flushMicrotasks ( ) ;
130
127
flush ( ) ;
131
128
132
129
expect ( getPanel ( ) ) . toBeFalsy ( ) ;
@@ -164,7 +161,6 @@ describe('MatTimepicker', () => {
164
161
fixture . detectChanges ( ) ;
165
162
getOptions ( ) [ 3 ] . click ( ) ; // Select 1:30 AM
166
163
fixture . detectChanges ( ) ;
167
- flushMicrotasks ( ) ; // Wait for Promise.resolve().then() to complete
168
164
flush ( ) ;
169
165
170
166
expect ( formControlValue ) . toBeTruthy ( ) ;
@@ -871,7 +867,6 @@ describe('MatTimepicker', () => {
871
867
872
868
const event = dispatchKeyboardEvent ( input , 'keydown' , ENTER ) ;
873
869
fixture . detectChanges ( ) ;
874
- flushMicrotasks ( ) ;
875
870
flush ( ) ;
876
871
877
872
expect ( input . value ) . toBe ( '1:30 AM' ) ;
@@ -965,7 +960,7 @@ describe('MatTimepicker', () => {
965
960
expect ( control . dirty ) . toBe ( true ) ;
966
961
} ) ;
967
962
968
- it ( 'should propagate value selected from the panel to the form control' , ( ) => {
963
+ it ( 'should propagate value selected from the panel to the form control' , fakeAsync ( ( ) => {
969
964
const fixture = TestBed . createComponent ( TimepickerWithForms ) ;
970
965
const control = fixture . componentInstance . control ;
971
966
fixture . detectChanges ( ) ;
@@ -976,11 +971,11 @@ describe('MatTimepicker', () => {
976
971
fixture . detectChanges ( ) ;
977
972
getOptions ( ) [ 5 ] . click ( ) ;
978
973
fixture . detectChanges ( ) ;
979
- flushMicrotasks ( ) ;
974
+ flush ( ) ;
980
975
981
976
expectSameTime ( control . value , createTime ( 2 , 30 ) ) ;
982
977
expect ( control . dirty ) . toBe ( true ) ;
983
- } ) ;
978
+ } ) ) ;
984
979
985
980
it ( 'should format values assigned to the input through the form control' , ( ) => {
986
981
const fixture = TestBed . createComponent ( TimepickerWithForms ) ;
@@ -1003,7 +998,7 @@ describe('MatTimepicker', () => {
1003
998
expect ( input . value ) . toBe ( '10:10 AM' ) ;
1004
999
} ) ;
1005
1000
1006
- it ( 'should not change the control if the same value is selected from the dropdown' , ( ) => {
1001
+ it ( 'should not change the control if the same value is selected from the dropdown' , fakeAsync ( ( ) => {
1007
1002
const fixture = TestBed . createComponent ( TimepickerWithForms ) ;
1008
1003
const control = fixture . componentInstance . control ;
1009
1004
control . setValue ( createTime ( 2 , 30 ) ) ;
@@ -1017,13 +1012,13 @@ describe('MatTimepicker', () => {
1017
1012
fixture . detectChanges ( ) ;
1018
1013
getOptions ( ) [ 5 ] . click ( ) ;
1019
1014
fixture . detectChanges ( ) ;
1020
- flushMicrotasks ( ) ;
1015
+ flush ( ) ;
1021
1016
1022
1017
expectSameTime ( control . value , createTime ( 2 , 30 ) ) ;
1023
1018
expect ( control . dirty ) . toBe ( false ) ;
1024
1019
expect ( spy ) . not . toHaveBeenCalled ( ) ;
1025
1020
subscription . unsubscribe ( ) ;
1026
- } ) ;
1021
+ } ) ) ;
1027
1022
1028
1023
it ( 'should not propagate programmatic changes to the form control' , ( ) => {
1029
1024
const fixture = TestBed . createComponent ( TimepickerWithForms ) ;
0 commit comments