@@ -10,6 +10,7 @@ import { IgxInputGroupModule } from '../input-group';
10
10
import { configureTestSuite } from '../test-utils/configure-suite' ;
11
11
import { InteractionMode } from '../core/enums' ;
12
12
import { IgxIconModule } from '../icon' ;
13
+ import { IgxOverlayOutletDirective , IgxToggleModule } from '../directives/toggle/toggle.directive' ;
13
14
14
15
describe ( 'IgxTimePicker' , ( ) => {
15
16
configureTestSuite ( ) ;
@@ -28,14 +29,16 @@ describe('IgxTimePicker', () => {
28
29
IgxTimePickerDropDownComponent ,
29
30
IgxTimePickerDropDownSingleHourComponent ,
30
31
IgxTimePickerDropDownNoValueComponent ,
31
- IgxTimePickerRetemplatedDropDownComponent
32
+ IgxTimePickerRetemplatedDropDownComponent ,
33
+ IgxTimePickerWithOutletComponent
32
34
] ,
33
35
imports : [
34
36
IgxTimePickerModule ,
35
37
FormsModule ,
36
38
NoopAnimationsModule ,
37
39
IgxInputGroupModule ,
38
- IgxIconModule
40
+ IgxIconModule ,
41
+ IgxToggleModule
39
42
]
40
43
} ) . compileComponents ( ) ;
41
44
} ) ) ;
@@ -1472,6 +1475,29 @@ describe('IgxTimePicker', () => {
1472
1475
1473
1476
expect ( document . getElementsByClassName ( 'igx-time-picker__buttons' ) . length ) . toEqual ( 0 ) ;
1474
1477
} ) ) ;
1478
+
1479
+ } ) ;
1480
+
1481
+ describe ( 'Timepicker with outlet' , ( ) => {
1482
+ configureTestSuite ( ) ;
1483
+ let fixture ;
1484
+ let timePicker ;
1485
+
1486
+ it ( 'should display the overlay in the provided outlet' , fakeAsync ( ( ) => {
1487
+ fixture = TestBed . createComponent ( IgxTimePickerWithOutletComponent ) ;
1488
+ timePicker = fixture . componentInstance . timepicker ;
1489
+ fixture . detectChanges ( ) ;
1490
+ const dom = fixture . debugElement ;
1491
+
1492
+ expect ( ( ) => {
1493
+ const timePickerTarget = dom . query ( By . directive ( IgxInputDirective ) ) ;
1494
+ UIInteractions . clickElement ( timePickerTarget ) ;
1495
+ tick ( ) ;
1496
+ fixture . detectChanges ( ) ;
1497
+ } ) . not . toThrowError ( ) ;
1498
+
1499
+ expect ( timePicker . outlet ) . toBeDefined ( ) ;
1500
+ } ) ) ;
1475
1501
} ) ;
1476
1502
1477
1503
describe ( 'TimePicker retemplating and customization' , ( ) => {
@@ -1959,6 +1985,16 @@ export class IgxTimePickerRetemplatedDropDownComponent {
1959
1985
}
1960
1986
}
1961
1987
1988
+ @Component ( {
1989
+ template : `
1990
+ <igx-time-picker [outlet]="outlet" #timepicker></igx-time-picker>
1991
+ <div igxOverlayOutlet #outlet="overlay-outlet"></div>
1992
+ `
1993
+ } )
1994
+ export class IgxTimePickerWithOutletComponent {
1995
+ @ViewChild ( 'timepicker' , { static : true } ) public timepicker : IgxTimePickerComponent ;
1996
+ }
1997
+
1962
1998
// helper functions
1963
1999
function findByInnerText ( collection , searchText ) {
1964
2000
for ( const element of collection ) {
0 commit comments