@@ -1303,14 +1303,14 @@ describe('igxCombo', () => {
13031303 } ) ) ;
13041304 it ( 'should toggle combo dropdown on toggle button click' , fakeAsync ( ( ) => {
13051305 spyOn ( combo , 'toggle' ) . and . callThrough ( ) ;
1306- input . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
1306+ input . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
13071307 tick ( ) ;
13081308 fixture . detectChanges ( ) ;
13091309 expect ( combo . collapsed ) . toEqual ( false ) ;
13101310 expect ( combo . toggle ) . toHaveBeenCalledTimes ( 1 ) ;
13111311 expect ( document . activeElement ) . toEqual ( combo . searchInput . nativeElement ) ;
13121312
1313- input . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
1313+ input . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
13141314 tick ( ) ;
13151315 fixture . detectChanges ( ) ;
13161316 expect ( combo . collapsed ) . toEqual ( true ) ;
@@ -1581,7 +1581,7 @@ describe('igxCombo', () => {
15811581 await wait ( 30 ) ;
15821582 fixture . detectChanges ( ) ;
15831583 let selectedItem = fixture . debugElement . queryAll ( By . css ( `.${ CSS_CLASS_DROPDOWNLISTITEM } ` ) ) [ 1 ] ;
1584- selectedItem . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
1584+ selectedItem . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
15851585 fixture . detectChanges ( ) ;
15861586 expect ( selectedItem . classes [ CSS_CLASS_SELECTED ] ) . toEqual ( true ) ;
15871587 const selectedItemText = selectedItem . nativeElement . textContent ;
@@ -1636,7 +1636,7 @@ describe('igxCombo', () => {
16361636 function simulateComboItemCheckboxClick ( itemIndex : number , isHeader = false ) {
16371637 const itemClass = isHeader ? CSS_CLASS_HEADERITEM : CSS_CLASS_DROPDOWNLISTITEM ;
16381638 const dropdownItem = fixture . debugElement . queryAll ( By . css ( '.' + itemClass ) ) [ itemIndex ] ;
1639- dropdownItem . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
1639+ dropdownItem . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
16401640 fixture . detectChanges ( ) ;
16411641 }
16421642 it ( 'should append/remove selected items to the input in their selection order' , ( ) => {
@@ -1687,7 +1687,7 @@ describe('igxCombo', () => {
16871687 expect ( combo . dropdown . items [ 6 ] . selected ) . toBeTruthy ( ) ;
16881688
16891689 const clearBtn = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
1690- clearBtn . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
1690+ clearBtn . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
16911691 fixture . detectChanges ( ) ;
16921692
16931693 expect ( input . nativeElement . value ) . toEqual ( '' ) ;
@@ -1721,7 +1721,8 @@ describe('igxCombo', () => {
17211721 expect ( fixture . debugElement . queryAll ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) . length ) . toEqual ( 1 ) ;
17221722
17231723 // Clear selected items
1724- fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
1724+ const clearButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
1725+ clearButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
17251726 fixture . detectChanges ( ) ;
17261727 fixture . detectChanges ( ) ;
17271728 expect ( fixture . debugElement . queryAll ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) . length ) . toBeFalsy ( ) ;
@@ -1744,7 +1745,7 @@ describe('igxCombo', () => {
17441745 oldSelection : [ ] ,
17451746 added : [ selectedItem_1 . value [ combo . valueKey ] ] ,
17461747 removed : [ ] ,
1747- event : UIInteractions . clickEvent ,
1748+ event : UIInteractions . getMouseEvent ( 'click' ) ,
17481749 displayText : selectedItem_1 . value [ combo . valueKey ] ,
17491750 cancel : false
17501751 } ) ;
@@ -1761,7 +1762,7 @@ describe('igxCombo', () => {
17611762 oldSelection : [ selectedItem_1 . value [ combo . valueKey ] ] ,
17621763 added : [ selectedItem_2 . value [ combo . valueKey ] ] ,
17631764 removed : [ ] ,
1764- event : UIInteractions . clickEvent ,
1765+ event : UIInteractions . getMouseEvent ( 'click' ) ,
17651766 displayText : selectedItem_1 . value [ combo . valueKey ] + ', ' + selectedItem_2 . value [ combo . valueKey ] ,
17661767 cancel : false
17671768 } ) ;
@@ -1779,7 +1780,7 @@ describe('igxCombo', () => {
17791780 oldSelection : [ selectedItem_1 . value [ combo . valueKey ] , selectedItem_2 . value [ combo . valueKey ] ] ,
17801781 added : [ ] ,
17811782 removed : [ unselectedItem . value [ combo . valueKey ] ] ,
1782- event : UIInteractions . clickEvent ,
1783+ event : UIInteractions . getMouseEvent ( 'click' ) ,
17831784 displayText : selectedItem_2 . value [ combo . valueKey ] ,
17841785 cancel : false
17851786 } ) ;
@@ -2186,13 +2187,13 @@ describe('igxCombo', () => {
21862187 const addItemButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_ADDBUTTON } ` ) ) ;
21872188 expect ( addItemButton . nativeElement ) . toBeDefined ( ) ;
21882189
2189- addItemButton . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
2190+ addItemButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
21902191 fixture . detectChanges ( ) ;
21912192 expect ( combo . selectedItems ( ) ) . toEqual ( [ 'New' ] ) ;
21922193 expect ( combo . comboInput . nativeElement . value ) . toEqual ( 'New' ) ;
21932194
21942195 const clearButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
2195- clearButton . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
2196+ clearButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
21962197 fixture . detectChanges ( ) ;
21972198 expect ( combo . selectedItems ( ) ) . toEqual ( [ ] ) ;
21982199 expect ( combo . comboInput . nativeElement . value ) . toEqual ( '' ) ;
@@ -2267,7 +2268,7 @@ describe('igxCombo', () => {
22672268 expect ( combo . value ) . toEqual ( '' ) ;
22682269
22692270 const focusedItem = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_FOCUSED } ` ) ) ;
2270- focusedItem . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
2271+ focusedItem . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
22712272 fixture . detectChanges ( ) ;
22722273 expect ( combo . collapsed ) . toBeFalsy ( ) ;
22732274 expect ( combo . value ) . toEqual ( 'My New Custom Item' ) ;
@@ -2356,7 +2357,7 @@ describe('igxCombo', () => {
23562357 expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
23572358 expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
23582359 const clearButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
2359- clearButton . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
2360+ clearButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
23602361 fixture . detectChanges ( ) ;
23612362 expect ( combo . valid ) . toEqual ( IgxComboState . INVALID ) ;
23622363 expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INVALID ) ;
@@ -2387,7 +2388,7 @@ describe('igxCombo', () => {
23872388 expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
23882389 expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
23892390 const clearButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
2390- clearButton . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
2391+ clearButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
23912392 fixture . detectChanges ( ) ;
23922393 expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
23932394 expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
@@ -2468,7 +2469,7 @@ describe('igxCombo', () => {
24682469 spyOn ( console , 'log' ) ;
24692470 fixture . detectChanges ( ) ;
24702471 expect ( form . status ) . toEqual ( 'VALID' ) ;
2471- fixture . debugElement . query ( By . css ( 'button' ) ) . triggerEventHandler ( 'click' , UIInteractions . clickElement ) ;
2472+ fixture . debugElement . query ( By . css ( 'button' ) ) . triggerEventHandler ( 'click' , UIInteractions . simulateClickAndSelectEvent ) ;
24722473 } ) ;
24732474 } ) ;
24742475 describe ( 'Template form tests: ' , ( ) => {
@@ -2510,7 +2511,7 @@ describe('igxCombo', () => {
25102511 expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . VALID ) ;
25112512
25122513 const clearButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
2513- clearButton . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
2514+ clearButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
25142515 fixture . detectChanges ( ) ;
25152516 expect ( combo . valid ) . toEqual ( IgxComboState . INVALID ) ;
25162517 expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INVALID ) ;
0 commit comments