@@ -10,7 +10,7 @@ import { configureTestSuite } from '../test-utils/configure-suite';
10
10
import { PickerInteractionMode } from '../date-common/types' ;
11
11
import { IgxIconModule } from '../icon/public_api' ;
12
12
import { IgxToggleDirective } from '../directives/toggle/toggle.directive' ;
13
- import { KEYS } from '../core/utils' ;
13
+ import { PlatformUtil } from '../core/utils' ;
14
14
import { DatePart } from '../directives/date-time-editor/public_api' ;
15
15
import { DateTimeUtil } from '../date-common/util/date-time.util' ;
16
16
@@ -41,7 +41,7 @@ describe('IgxTimePicker', () => {
41
41
const mockDateTimeEditorDirective = jasmine . createSpyObj ( 'IgxDateTimeEditorDirective' , [ 'increment' , 'decrement' ] , { value : null } ) ;
42
42
43
43
it ( 'should open/close the dropdown with open()/close() method' , ( ) => {
44
- timePicker = new IgxTimePickerComponent ( elementRef , null , null , null , mockInjector ) ;
44
+ timePicker = new IgxTimePickerComponent ( elementRef , null , null , null , mockInjector , null ) ;
45
45
( timePicker as any ) . dateTimeEditor = mockDateTimeEditorDirective ;
46
46
const mockToggleDirective = jasmine . createSpyObj ( 'IgxToggleDirective' , [ 'open' , 'close' ] , { collapsed : true } ) ;
47
47
( timePicker as any ) . toggleRef = mockToggleDirective ;
@@ -56,7 +56,7 @@ describe('IgxTimePicker', () => {
56
56
} ) ;
57
57
58
58
it ( 'should open/close the dropdown with toggle() method' , ( ) => {
59
- timePicker = new IgxTimePickerComponent ( elementRef , null , null , null , mockInjector ) ;
59
+ timePicker = new IgxTimePickerComponent ( elementRef , null , null , null , mockInjector , null ) ;
60
60
( timePicker as any ) . dateTimeEditor = mockDateTimeEditorDirective ;
61
61
const mockToggleDirective = jasmine . createSpyObj ( 'IgxToggleDirective' , [ 'open' , 'close' ] , { collapsed : true } ) ;
62
62
( timePicker as any ) . toggleRef = mockToggleDirective ;
@@ -71,7 +71,7 @@ describe('IgxTimePicker', () => {
71
71
} ) ;
72
72
73
73
it ( 'should reset value and emit valueChange with clear() method' , ( ) => {
74
- timePicker = new IgxTimePickerComponent ( elementRef , null , null , null , null ) ;
74
+ timePicker = new IgxTimePickerComponent ( elementRef , null , null , null , null , null ) ;
75
75
( timePicker as any ) . dateTimeEditor = mockDateTimeEditorDirective ;
76
76
const mockToggleDirective = jasmine . createSpyObj ( 'IgxToggleDirective' , { collapsed : true } ) ;
77
77
( timePicker as any ) . toggleRef = mockToggleDirective ;
@@ -96,7 +96,7 @@ describe('IgxTimePicker', () => {
96
96
} ) ;
97
97
98
98
it ( 'should not emit valueChange when value is \'00:00:00\' and is cleared' , ( ) => {
99
- timePicker = new IgxTimePickerComponent ( elementRef , null , null , null , null ) ;
99
+ timePicker = new IgxTimePickerComponent ( elementRef , null , null , null , null , null ) ;
100
100
( timePicker as any ) . dateTimeEditor = mockDateTimeEditorDirective ;
101
101
const mockToggleDirective = jasmine . createSpyObj ( 'IgxToggleDirective' , { collapsed : true } ) ;
102
102
( timePicker as any ) . toggleRef = mockToggleDirective ;
@@ -112,7 +112,7 @@ describe('IgxTimePicker', () => {
112
112
} ) ;
113
113
114
114
it ( 'should not emit valueChange when value is null and is cleared' , ( ) => {
115
- timePicker = new IgxTimePickerComponent ( elementRef , null , null , null , null ) ;
115
+ timePicker = new IgxTimePickerComponent ( elementRef , null , null , null , null , null ) ;
116
116
( timePicker as any ) . dateTimeEditor = mockDateTimeEditorDirective ;
117
117
const mockToggleDirective = jasmine . createSpyObj ( 'IgxToggleDirective' , { collapsed : true } ) ;
118
118
( timePicker as any ) . toggleRef = mockToggleDirective ;
@@ -125,7 +125,7 @@ describe('IgxTimePicker', () => {
125
125
} ) ;
126
126
127
127
it ( 'should select time and trigger valueChange event with select() method' , ( ) => {
128
- timePicker = new IgxTimePickerComponent ( elementRef , null , null , null , null ) ;
128
+ timePicker = new IgxTimePickerComponent ( elementRef , null , null , null , null , null ) ;
129
129
( timePicker as any ) . dateTimeEditor = mockDateTimeEditorDirective ;
130
130
131
131
const date = new Date ( 2020 , 12 , 12 , 10 , 30 , 30 ) ;
@@ -141,7 +141,7 @@ describe('IgxTimePicker', () => {
141
141
} ) ;
142
142
143
143
it ( 'should fire vallidationFailed on selecting time outside min/max range' , ( ) => {
144
- timePicker = new IgxTimePickerComponent ( elementRef , null , null , null , null ) ;
144
+ timePicker = new IgxTimePickerComponent ( elementRef , null , null , null , null , null ) ;
145
145
( timePicker as any ) . dateTimeEditor = mockDateTimeEditorDirective ;
146
146
147
147
const date = new Date ( 2020 , 12 , 12 , 10 , 30 , 30 ) ;
@@ -162,7 +162,7 @@ describe('IgxTimePicker', () => {
162
162
} ) ;
163
163
164
164
xit ( 'should change date parts correctly with increment() and decrement() methods' , ( ) => {
165
- timePicker = new IgxTimePickerComponent ( elementRef , null , null , null , null ) ;
165
+ timePicker = new IgxTimePickerComponent ( elementRef , null , null , null , null , null ) ;
166
166
( timePicker as any ) . dateTimeEditor = mockDateTimeEditorDirective ;
167
167
168
168
const date = new Date ( 2020 , 12 , 12 , 10 , 30 , 30 ) ;
@@ -202,7 +202,8 @@ describe('IgxTimePicker', () => {
202
202
IgxInputGroupModule ,
203
203
IgxIconModule ,
204
204
FormsModule ,
205
- NoopAnimationsModule ]
205
+ NoopAnimationsModule ] ,
206
+ providers : [ PlatformUtil ]
206
207
} ) . compileComponents ( ) ;
207
208
} ) ) ;
208
209
beforeEach ( fakeAsync ( ( ) => {
@@ -280,7 +281,7 @@ describe('IgxTimePicker', () => {
280
281
} ) ) ;
281
282
282
283
it ( 'should open/close the dropdown and keep the current selection on Space/Enter key press' , fakeAsync ( ( ) => {
283
- UIInteractions . triggerKeyDownEvtUponElem ( KEYS . SPACE , input . nativeElement , true ) ;
284
+ UIInteractions . triggerKeyDownEvtUponElem ( 'Space' , input . nativeElement , true ) ;
284
285
tick ( ) ;
285
286
fixture . detectChanges ( ) ;
286
287
expect ( toggleDirective . collapsed ) . toBeFalsy ( ) ;
@@ -289,7 +290,7 @@ describe('IgxTimePicker', () => {
289
290
hourColumn . triggerEventHandler ( 'wheel' , event ) ;
290
291
fixture . detectChanges ( ) ;
291
292
292
- UIInteractions . triggerKeyDownEvtUponElem ( KEYS . ENTER , hourColumn . nativeElement ) ;
293
+ UIInteractions . triggerKeyDownEvtUponElem ( 'Enter' , hourColumn . nativeElement ) ;
293
294
tick ( ) ;
294
295
fixture . detectChanges ( ) ;
295
296
expect ( toggleDirective . collapsed ) . toBeTruthy ( ) ;
@@ -316,7 +317,7 @@ describe('IgxTimePicker', () => {
316
317
const selectedHour = fixture . componentInstance . date . getHours ( ) - 3 ;
317
318
expect ( ( timePicker . value as Date ) . getHours ( ) ) . toEqual ( selectedHour ) ;
318
319
319
- UIInteractions . triggerKeyDownEvtUponElem ( KEYS . ESCAPE , input . nativeElement , true ) ;
320
+ UIInteractions . triggerKeyDownEvtUponElem ( 'Escape' , input . nativeElement , true ) ;
320
321
tick ( ) ;
321
322
fixture . detectChanges ( ) ;
322
323
expect ( toggleDirective . collapsed ) . toBeTruthy ( ) ;
0 commit comments