Skip to content

Commit 418dcdf

Browse files
committed
refactor(grid): fix hierarchical moving state behavior
1 parent 244f654 commit 418dcdf

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

projects/igniteui-angular/src/lib/grids/state.directive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ export class IgxGridStateDirective {
113113
columnSelection: true,
114114
rowPinning: true,
115115
expansion: true,
116-
rowIslands: true,
117-
moving: true
116+
moving: true,
117+
rowIslands: true
118118
};
119119
private FEATURES = {
120120
sorting: {

projects/igniteui-angular/src/lib/grids/state.hierarchicalgrid.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,14 @@ describe('IgxHierarchicalGridState - input properties #hGrid', () => {
168168
gridState = state.getState(false, ['moving', 'rowIslands']) as IGridState;
169169
HelperFunctions.verifyMoving(grid.moving, gridState);
170170
});
171-
172171

173172
it('setState should correctly restore grid moving state from string', fakeAsync(() => {
174173
const state = fix.componentInstance.state;
175174

176175
const initialState = HelperFunctions.buildStateString(grid, 'moving', 'true', 'true');
177-
const movingState = HelperFunctions.buildStateString(grid, 'moving', 'false', 'true');
176+
const movingState = HelperFunctions.buildStateString(grid, 'moving', 'false', 'false');
178177

179178
const movingStateObject = JSON.parse(movingState) as IGridState;
180-
movingStateObject.columns = fix.componentInstance.childColumns;
181179

182180
let gridState = state.getState(true, ['moving', 'rowIslands']);
183181
expect(gridState).toBe(initialState);
@@ -189,7 +187,7 @@ describe('IgxHierarchicalGridState - input properties #hGrid', () => {
189187
HelperFunctions.verifyMoving(grid.moving, gridState);
190188
const gridsCollection = HelperFunctions.getChildGridsCollection(grid, gridState);
191189
gridsCollection.forEach(childGrid => {
192-
expect(childGrid.grid.moving).toEqual(childGrid.grid.moving);
190+
HelperFunctions.verifyMoving(childGrid.grid.moving, childGrid.state);
193191
});
194192
gridState = state.getState(true, ['moving', 'rowIslands']);
195193
expect(gridState).toBe(movingState);

0 commit comments

Comments
 (0)