@@ -1766,7 +1766,10 @@ describe('IgxTimePicker', () => {
17661766
17671767 describe ( 'Hour/minute only mode' , ( ) => {
17681768 configureTestSuite ( ) ;
1769- let fixture , timePicker , dom , input ;
1769+ let fixture : ComponentFixture < IgxTimePickerDropDownSingleHourComponent > ,
1770+ timePicker : IgxTimePickerComponent ,
1771+ dom : DebugElement ,
1772+ input : DebugElement ;
17701773
17711774 beforeEach (
17721775 async ( ( ) => {
@@ -1841,6 +1844,21 @@ describe('IgxTimePicker', () => {
18411844 expect ( _input . nativeElement . value ) . toEqual ( '12 AM' ) ;
18421845 } ) ) ;
18431846
1847+ it ( 'Should properly switch between AM/PM when typing' , ( ) => {
1848+ fixture . componentInstance . format = 'hh tt' ;
1849+ fixture . componentInstance . customDate = new Date ( 2018 , 10 , 27 , 17 , 45 , 0 , 0 ) ;
1850+ fixture . detectChanges ( ) ;
1851+
1852+ input . triggerEventHandler ( 'focus' , { target : input . nativeElement } ) ;
1853+ UIInteractions . simulateTyping ( 'pm' , input , 2 , 4 ) ;
1854+ fixture . detectChanges ( ) ;
1855+ expect ( input . nativeElement . value ) . toEqual ( '05 pm' ) ;
1856+
1857+ input . triggerEventHandler ( 'blur' , { target : input . nativeElement } ) ;
1858+ fixture . detectChanges ( ) ;
1859+ expect ( input . nativeElement . value ) . toEqual ( '05 PM' ) ;
1860+ } ) ;
1861+
18441862 it ( 'Should navigate dropdown lists correctly when format contains only hours.' , fakeAsync ( ( ) => {
18451863 fixture . componentInstance . format = 'hh tt' ;
18461864 fixture . componentInstance . customDate = new Date ( 2018 , 10 , 27 , 17 , 45 , 0 ) ;
0 commit comments