@@ -2580,6 +2580,47 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
25802580 ControlsFunction . verifyButtonIsDisabled ( moveLeft , false ) ;
25812581 } ) ) ;
25822582
2583+ fit ( 'Should right pin and unpin column after moving it left/right when clicking buttons.' , fakeAsync ( ( ) => {
2584+ grid . pinning . columns = 1 ;
2585+
2586+ const columnToPin = grid . columns [ grid . columns . length - 2 ] ;
2587+ columnToPin . pinned = true ;
2588+ fix . detectChanges ( ) ;
2589+
2590+ expect ( grid . pinnedColumns . length ) . toBe ( 1 ) ;
2591+
2592+ const columnToMove = grid . unpinnedColumns [ grid . unpinnedColumns . length - 1 ] ;
2593+ columnToMove . movable = true ;
2594+
2595+ GridFunctions . clickExcelFilterIconFromCode ( fix , grid , columnToMove . field ) ;
2596+
2597+ const moveLeft = GridFunctions . getExcelStyleFilteringMoveButtons ( fix ) [ 0 ] ;
2598+ const moveRight = GridFunctions . getExcelStyleFilteringMoveButtons ( fix ) [ 1 ] ;
2599+
2600+ moveRight . click ( ) ;
2601+ fix . detectChanges ( ) ;
2602+
2603+ expect ( grid . pinnedColumns . length ) . toBe ( 2 ) ;
2604+
2605+ expect ( grid . pinnedColumns [ 0 ] . field ) . toBe ( columnToMove . field ) ;
2606+ expect ( grid . pinnedColumns [ 1 ] . field ) . toBe ( columnToPin . field ) ;
2607+
2608+ moveRight . click ( ) ;
2609+ fix . detectChanges ( ) ;
2610+
2611+ expect ( grid . pinnedColumns [ 0 ] . field ) . toBe ( columnToPin . field ) ;
2612+ expect ( grid . pinnedColumns [ 1 ] . field ) . toBe ( columnToMove . field ) ;
2613+
2614+ moveLeft . click ( ) ;
2615+ fix . detectChanges ( ) ;
2616+
2617+ moveLeft . click ( ) ;
2618+ fix . detectChanges ( ) ;
2619+
2620+ expect ( grid . pinnedColumns . length ) . toBe ( 1 ) ;
2621+ expect ( grid . pinnedColumns [ 0 ] . field ) . toBe ( columnToPin . field ) ;
2622+ } ) ) ;
2623+
25832624 it ( 'Should pin column when clicking buttons.' , fakeAsync ( ( ) => {
25842625 GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'Downloads' ) ;
25852626
0 commit comments