@@ -1334,14 +1334,14 @@ describe('igxCombo', () => {
13341334 } ) ) ;
13351335 it ( 'should toggle combo dropdown on toggle button click' , fakeAsync ( ( ) => {
13361336 spyOn ( combo , 'toggle' ) . and . callThrough ( ) ;
1337- input . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
1337+ input . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
13381338 tick ( ) ;
13391339 fixture . detectChanges ( ) ;
13401340 expect ( combo . collapsed ) . toEqual ( false ) ;
13411341 expect ( combo . toggle ) . toHaveBeenCalledTimes ( 1 ) ;
13421342 expect ( document . activeElement ) . toEqual ( combo . searchInput . nativeElement ) ;
13431343
1344- input . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
1344+ input . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
13451345 tick ( ) ;
13461346 fixture . detectChanges ( ) ;
13471347 expect ( combo . collapsed ) . toEqual ( true ) ;
@@ -1612,7 +1612,7 @@ describe('igxCombo', () => {
16121612 await wait ( 30 ) ;
16131613 fixture . detectChanges ( ) ;
16141614 let selectedItem = fixture . debugElement . queryAll ( By . css ( `.${ CSS_CLASS_DROPDOWNLISTITEM } ` ) ) [ 1 ] ;
1615- selectedItem . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
1615+ selectedItem . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
16161616 fixture . detectChanges ( ) ;
16171617 expect ( selectedItem . classes [ CSS_CLASS_SELECTED ] ) . toEqual ( true ) ;
16181618 const selectedItemText = selectedItem . nativeElement . textContent ;
@@ -1667,7 +1667,7 @@ describe('igxCombo', () => {
16671667 function simulateComboItemCheckboxClick ( itemIndex : number , isHeader = false ) {
16681668 const itemClass = isHeader ? CSS_CLASS_HEADERITEM : CSS_CLASS_DROPDOWNLISTITEM ;
16691669 const dropdownItem = fixture . debugElement . queryAll ( By . css ( '.' + itemClass ) ) [ itemIndex ] ;
1670- dropdownItem . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
1670+ dropdownItem . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
16711671 fixture . detectChanges ( ) ;
16721672 }
16731673 it ( 'should append/remove selected items to the input in their selection order' , ( ) => {
@@ -1718,7 +1718,7 @@ describe('igxCombo', () => {
17181718 expect ( combo . dropdown . items [ 6 ] . selected ) . toBeTruthy ( ) ;
17191719
17201720 const clearBtn = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
1721- clearBtn . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
1721+ clearBtn . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
17221722 fixture . detectChanges ( ) ;
17231723
17241724 expect ( input . nativeElement . value ) . toEqual ( '' ) ;
@@ -1752,7 +1752,8 @@ describe('igxCombo', () => {
17521752 expect ( fixture . debugElement . queryAll ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) . length ) . toEqual ( 1 ) ;
17531753
17541754 // Clear selected items
1755- fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
1755+ const clearButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
1756+ clearButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
17561757 fixture . detectChanges ( ) ;
17571758 fixture . detectChanges ( ) ;
17581759 expect ( fixture . debugElement . queryAll ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) . length ) . toBeFalsy ( ) ;
@@ -1775,7 +1776,7 @@ describe('igxCombo', () => {
17751776 oldSelection : [ ] ,
17761777 added : [ selectedItem_1 . value [ combo . valueKey ] ] ,
17771778 removed : [ ] ,
1778- event : UIInteractions . clickEvent ,
1779+ event : UIInteractions . getMouseEvent ( 'click' ) ,
17791780 displayText : selectedItem_1 . value [ combo . valueKey ] ,
17801781 cancel : false
17811782 } ) ;
@@ -1792,7 +1793,7 @@ describe('igxCombo', () => {
17921793 oldSelection : [ selectedItem_1 . value [ combo . valueKey ] ] ,
17931794 added : [ selectedItem_2 . value [ combo . valueKey ] ] ,
17941795 removed : [ ] ,
1795- event : UIInteractions . clickEvent ,
1796+ event : UIInteractions . getMouseEvent ( 'click' ) ,
17961797 displayText : selectedItem_1 . value [ combo . valueKey ] + ', ' + selectedItem_2 . value [ combo . valueKey ] ,
17971798 cancel : false
17981799 } ) ;
@@ -1810,7 +1811,7 @@ describe('igxCombo', () => {
18101811 oldSelection : [ selectedItem_1 . value [ combo . valueKey ] , selectedItem_2 . value [ combo . valueKey ] ] ,
18111812 added : [ ] ,
18121813 removed : [ unselectedItem . value [ combo . valueKey ] ] ,
1813- event : UIInteractions . clickEvent ,
1814+ event : UIInteractions . getMouseEvent ( 'click' ) ,
18141815 displayText : selectedItem_2 . value [ combo . valueKey ] ,
18151816 cancel : false
18161817 } ) ;
@@ -2217,13 +2218,13 @@ describe('igxCombo', () => {
22172218 const addItemButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_ADDBUTTON } ` ) ) ;
22182219 expect ( addItemButton . nativeElement ) . toBeDefined ( ) ;
22192220
2220- addItemButton . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
2221+ addItemButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
22212222 fixture . detectChanges ( ) ;
22222223 expect ( combo . selectedItems ( ) ) . toEqual ( [ 'New' ] ) ;
22232224 expect ( combo . comboInput . nativeElement . value ) . toEqual ( 'New' ) ;
22242225
22252226 const clearButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
2226- clearButton . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
2227+ clearButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
22272228 fixture . detectChanges ( ) ;
22282229 expect ( combo . selectedItems ( ) ) . toEqual ( [ ] ) ;
22292230 expect ( combo . comboInput . nativeElement . value ) . toEqual ( '' ) ;
@@ -2298,7 +2299,7 @@ describe('igxCombo', () => {
22982299 expect ( combo . value ) . toEqual ( '' ) ;
22992300
23002301 const focusedItem = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_FOCUSED } ` ) ) ;
2301- focusedItem . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
2302+ focusedItem . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
23022303 fixture . detectChanges ( ) ;
23032304 expect ( combo . collapsed ) . toBeFalsy ( ) ;
23042305 expect ( combo . value ) . toEqual ( 'My New Custom Item' ) ;
@@ -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 . INVALID ) ;
23932394 expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INVALID ) ;
@@ -2418,7 +2419,7 @@ describe('igxCombo', () => {
24182419 expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
24192420 expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
24202421 const clearButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
2421- clearButton . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
2422+ clearButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
24222423 fixture . detectChanges ( ) ;
24232424 expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
24242425 expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
@@ -2499,7 +2500,7 @@ describe('igxCombo', () => {
24992500 spyOn ( console , 'log' ) ;
25002501 fixture . detectChanges ( ) ;
25012502 expect ( form . status ) . toEqual ( 'VALID' ) ;
2502- fixture . debugElement . query ( By . css ( 'button' ) ) . triggerEventHandler ( 'click' , UIInteractions . clickElement ) ;
2503+ fixture . debugElement . query ( By . css ( 'button' ) ) . triggerEventHandler ( 'click' , UIInteractions . simulateClickAndSelectEvent ) ;
25032504 } ) ;
25042505 } ) ;
25052506 describe ( 'Template form tests: ' , ( ) => {
@@ -2541,7 +2542,7 @@ describe('igxCombo', () => {
25412542 expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . VALID ) ;
25422543
25432544 const clearButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
2544- clearButton . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
2545+ clearButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
25452546 fixture . detectChanges ( ) ;
25462547 expect ( combo . valid ) . toEqual ( IgxComboState . INVALID ) ;
25472548 expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INVALID ) ;
0 commit comments