@@ -1334,14 +1334,14 @@ describe('igxCombo', () => {
1334
1334
} ) ) ;
1335
1335
it ( 'should toggle combo dropdown on toggle button click' , fakeAsync ( ( ) => {
1336
1336
spyOn ( combo , 'toggle' ) . and . callThrough ( ) ;
1337
- input . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
1337
+ input . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
1338
1338
tick ( ) ;
1339
1339
fixture . detectChanges ( ) ;
1340
1340
expect ( combo . collapsed ) . toEqual ( false ) ;
1341
1341
expect ( combo . toggle ) . toHaveBeenCalledTimes ( 1 ) ;
1342
1342
expect ( document . activeElement ) . toEqual ( combo . searchInput . nativeElement ) ;
1343
1343
1344
- input . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
1344
+ input . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
1345
1345
tick ( ) ;
1346
1346
fixture . detectChanges ( ) ;
1347
1347
expect ( combo . collapsed ) . toEqual ( true ) ;
@@ -1612,7 +1612,7 @@ describe('igxCombo', () => {
1612
1612
await wait ( 30 ) ;
1613
1613
fixture . detectChanges ( ) ;
1614
1614
let selectedItem = fixture . debugElement . queryAll ( By . css ( `.${ CSS_CLASS_DROPDOWNLISTITEM } ` ) ) [ 1 ] ;
1615
- selectedItem . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
1615
+ selectedItem . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
1616
1616
fixture . detectChanges ( ) ;
1617
1617
expect ( selectedItem . classes [ CSS_CLASS_SELECTED ] ) . toEqual ( true ) ;
1618
1618
const selectedItemText = selectedItem . nativeElement . textContent ;
@@ -1667,7 +1667,7 @@ describe('igxCombo', () => {
1667
1667
function simulateComboItemCheckboxClick ( itemIndex : number , isHeader = false ) {
1668
1668
const itemClass = isHeader ? CSS_CLASS_HEADERITEM : CSS_CLASS_DROPDOWNLISTITEM ;
1669
1669
const dropdownItem = fixture . debugElement . queryAll ( By . css ( '.' + itemClass ) ) [ itemIndex ] ;
1670
- dropdownItem . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
1670
+ dropdownItem . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
1671
1671
fixture . detectChanges ( ) ;
1672
1672
}
1673
1673
it ( 'should append/remove selected items to the input in their selection order' , ( ) => {
@@ -1718,7 +1718,7 @@ describe('igxCombo', () => {
1718
1718
expect ( combo . dropdown . items [ 6 ] . selected ) . toBeTruthy ( ) ;
1719
1719
1720
1720
const clearBtn = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
1721
- clearBtn . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
1721
+ clearBtn . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
1722
1722
fixture . detectChanges ( ) ;
1723
1723
1724
1724
expect ( input . nativeElement . value ) . toEqual ( '' ) ;
@@ -1752,7 +1752,8 @@ describe('igxCombo', () => {
1752
1752
expect ( fixture . debugElement . queryAll ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) . length ) . toEqual ( 1 ) ;
1753
1753
1754
1754
// 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' ) ) ;
1756
1757
fixture . detectChanges ( ) ;
1757
1758
fixture . detectChanges ( ) ;
1758
1759
expect ( fixture . debugElement . queryAll ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) . length ) . toBeFalsy ( ) ;
@@ -1775,7 +1776,7 @@ describe('igxCombo', () => {
1775
1776
oldSelection : [ ] ,
1776
1777
added : [ selectedItem_1 . value [ combo . valueKey ] ] ,
1777
1778
removed : [ ] ,
1778
- event : UIInteractions . clickEvent ,
1779
+ event : UIInteractions . getMouseEvent ( 'click' ) ,
1779
1780
displayText : selectedItem_1 . value [ combo . valueKey ] ,
1780
1781
cancel : false
1781
1782
} ) ;
@@ -1792,7 +1793,7 @@ describe('igxCombo', () => {
1792
1793
oldSelection : [ selectedItem_1 . value [ combo . valueKey ] ] ,
1793
1794
added : [ selectedItem_2 . value [ combo . valueKey ] ] ,
1794
1795
removed : [ ] ,
1795
- event : UIInteractions . clickEvent ,
1796
+ event : UIInteractions . getMouseEvent ( 'click' ) ,
1796
1797
displayText : selectedItem_1 . value [ combo . valueKey ] + ', ' + selectedItem_2 . value [ combo . valueKey ] ,
1797
1798
cancel : false
1798
1799
} ) ;
@@ -1810,7 +1811,7 @@ describe('igxCombo', () => {
1810
1811
oldSelection : [ selectedItem_1 . value [ combo . valueKey ] , selectedItem_2 . value [ combo . valueKey ] ] ,
1811
1812
added : [ ] ,
1812
1813
removed : [ unselectedItem . value [ combo . valueKey ] ] ,
1813
- event : UIInteractions . clickEvent ,
1814
+ event : UIInteractions . getMouseEvent ( 'click' ) ,
1814
1815
displayText : selectedItem_2 . value [ combo . valueKey ] ,
1815
1816
cancel : false
1816
1817
} ) ;
@@ -2217,13 +2218,13 @@ describe('igxCombo', () => {
2217
2218
const addItemButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_ADDBUTTON } ` ) ) ;
2218
2219
expect ( addItemButton . nativeElement ) . toBeDefined ( ) ;
2219
2220
2220
- addItemButton . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
2221
+ addItemButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
2221
2222
fixture . detectChanges ( ) ;
2222
2223
expect ( combo . selectedItems ( ) ) . toEqual ( [ 'New' ] ) ;
2223
2224
expect ( combo . comboInput . nativeElement . value ) . toEqual ( 'New' ) ;
2224
2225
2225
2226
const clearButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
2226
- clearButton . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
2227
+ clearButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
2227
2228
fixture . detectChanges ( ) ;
2228
2229
expect ( combo . selectedItems ( ) ) . toEqual ( [ ] ) ;
2229
2230
expect ( combo . comboInput . nativeElement . value ) . toEqual ( '' ) ;
@@ -2298,7 +2299,7 @@ describe('igxCombo', () => {
2298
2299
expect ( combo . value ) . toEqual ( '' ) ;
2299
2300
2300
2301
const focusedItem = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_FOCUSED } ` ) ) ;
2301
- focusedItem . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
2302
+ focusedItem . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
2302
2303
fixture . detectChanges ( ) ;
2303
2304
expect ( combo . collapsed ) . toBeFalsy ( ) ;
2304
2305
expect ( combo . value ) . toEqual ( 'My New Custom Item' ) ;
@@ -2387,7 +2388,7 @@ describe('igxCombo', () => {
2387
2388
expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
2388
2389
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
2389
2390
const clearButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
2390
- clearButton . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
2391
+ clearButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
2391
2392
fixture . detectChanges ( ) ;
2392
2393
expect ( combo . valid ) . toEqual ( IgxComboState . INVALID ) ;
2393
2394
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INVALID ) ;
@@ -2418,7 +2419,7 @@ describe('igxCombo', () => {
2418
2419
expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
2419
2420
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
2420
2421
const clearButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
2421
- clearButton . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
2422
+ clearButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
2422
2423
fixture . detectChanges ( ) ;
2423
2424
expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
2424
2425
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
@@ -2499,7 +2500,7 @@ describe('igxCombo', () => {
2499
2500
spyOn ( console , 'log' ) ;
2500
2501
fixture . detectChanges ( ) ;
2501
2502
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 ) ;
2503
2504
} ) ;
2504
2505
} ) ;
2505
2506
describe ( 'Template form tests: ' , ( ) => {
@@ -2541,7 +2542,7 @@ describe('igxCombo', () => {
2541
2542
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . VALID ) ;
2542
2543
2543
2544
const clearButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
2544
- clearButton . triggerEventHandler ( 'click' , UIInteractions . clickEvent ) ;
2545
+ clearButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
2545
2546
fixture . detectChanges ( ) ;
2546
2547
expect ( combo . valid ) . toEqual ( IgxComboState . INVALID ) ;
2547
2548
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INVALID ) ;
0 commit comments