Skip to content

Commit 5dc55ea

Browse files
committed
test(state): update tests to use rowIslands #7025
1 parent 8cedc17 commit 5dc55ea

File tree

2 files changed

+40
-40
lines changed

2 files changed

+40
-40
lines changed

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

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('IgxHierarchicalGridState - input properties #hGrid', () => {
5454
rowSelection: true,
5555
columnSelection: true,
5656
expansion: true,
57-
inheritance: true
57+
rowIslands: true
5858
};
5959

6060
const state = fix.componentInstance.state;
@@ -81,7 +81,7 @@ describe('IgxHierarchicalGridState - input properties #hGrid', () => {
8181
rowSelection: true,
8282
columnSelection: true,
8383
expansion: true,
84-
inheritance: false
84+
rowIslands: false
8585
};
8686

8787
const state = fix.componentInstance.state;
@@ -150,7 +150,7 @@ describe('IgxHierarchicalGridState - input properties #hGrid', () => {
150150
expect(childGrid.state['paging']).toBeFalsy();
151151
});
152152

153-
gridState = state.getState(false, ['filtering', 'sorting', 'paging', 'inheritance']) as IGridState;
153+
gridState = state.getState(false, ['filtering', 'sorting', 'paging', 'rowIslands']) as IGridState;
154154
expect(gridState['sorting']).toBeFalsy();
155155
expect(gridState['paging']).toBeFalsy();
156156
});
@@ -162,10 +162,10 @@ describe('IgxHierarchicalGridState - input properties #hGrid', () => {
162162
const emptyFiltering = '{"filteringOperands":[],"operator":0}';
163163
const initialState = HelperFunctions.buildStateString(grid, 'filtering', emptyFiltering, emptyFiltering);
164164

165-
let gridState = state.getState(true, ['filtering', 'inheritance']);
165+
let gridState = state.getState(true, ['filtering', 'rowIslands']);
166166
expect(gridState).toBe(initialState);
167167

168-
gridState = state.getState(false, ['filtering', 'inheritance']) as IGridState;
168+
gridState = state.getState(false, ['filtering', 'rowIslands']) as IGridState;
169169
HelperFunctions.verifyFilteringExpressions(filtering, gridState);
170170
});
171171

@@ -181,17 +181,17 @@ describe('IgxHierarchicalGridState - input properties #hGrid', () => {
181181
const filteringStateObject = JSON.parse(filteringState) as IGridState;
182182
filteringStateObject.columns = fix.componentInstance.childColumns;
183183

184-
let gridState = state.getState(true, ['filtering', 'inheritance']);
184+
let gridState = state.getState(true, ['filtering', 'rowIslands']);
185185
expect(gridState).toBe(initialState);
186186

187187
state.setState(JSON.stringify(filteringStateObject));
188-
gridState = state.getState(false, ['filtering', 'inheritance']) as IGridState;
188+
gridState = state.getState(false, ['filtering', 'rowIslands']) as IGridState;
189189
HelperFunctions.verifyFilteringExpressions(grid.filteringExpressionsTree, gridState);
190190
const gridsCollection = HelperFunctions.getChildGridsCollection(grid, gridState);
191191
gridsCollection.forEach(childGrid => {
192192
HelperFunctions.verifyFilteringExpressions(childGrid.grid.filteringExpressionsTree, childGrid.state);
193193
});
194-
gridState = state.getState(true, ['filtering', 'inheritance']);
194+
gridState = state.getState(true, ['filtering', 'rowIslands']);
195195
expect(gridState).toBe(filteringState);
196196
});
197197

@@ -207,17 +207,17 @@ describe('IgxHierarchicalGridState - input properties #hGrid', () => {
207207
const filteringStateObject = JSON.parse(filteringState) as IGridState;
208208
filteringStateObject.columns = fix.componentInstance.childColumns;
209209

210-
let gridState = state.getState(true, ['filtering', 'inheritance']);
210+
let gridState = state.getState(true, ['filtering', 'rowIslands']);
211211
expect(gridState).toBe(initialState);
212212

213213
state.setState(filteringStateObject);
214-
gridState = state.getState(false, ['filtering', 'inheritance']) as IGridState;
214+
gridState = state.getState(false, ['filtering', 'rowIslands']) as IGridState;
215215
HelperFunctions.verifyFilteringExpressions(grid.filteringExpressionsTree, gridState);
216216
const gridsCollection = HelperFunctions.getChildGridsCollection(grid, gridState);
217217
gridsCollection.forEach(childGrid => {
218218
HelperFunctions.verifyFilteringExpressions(childGrid.grid.filteringExpressionsTree, childGrid.state);
219219
});
220-
gridState = state.getState(true, ['filtering', 'inheritance']);
220+
gridState = state.getState(true, ['filtering', 'rowIslands']);
221221
expect(gridState).toBe(filteringState);
222222
});
223223

@@ -228,7 +228,7 @@ describe('IgxHierarchicalGridState - input properties #hGrid', () => {
228228
const emptySorting = '[]';
229229
let initialState = HelperFunctions.buildStateString(grid, 'sorting', emptySorting, emptySorting);
230230

231-
let gridState = state.getState(true, ['sorting', 'inheritance']);
231+
let gridState = state.getState(true, ['sorting', 'rowIslands']);
232232
expect(gridState).toBe(initialState);
233233

234234
grid.sortingExpressions = [
@@ -240,17 +240,17 @@ describe('IgxHierarchicalGridState - input properties #hGrid', () => {
240240
initialState = HelperFunctions.buildStateString(grid, 'sorting', sorting, emptySorting, emptySorting);
241241
const sortingState = HelperFunctions.buildStateString(grid, 'sorting', sorting, sorting);
242242

243-
gridState = state.getState(true, ['sorting', 'inheritance']);
243+
gridState = state.getState(true, ['sorting', 'rowIslands']);
244244
expect(gridState).toBe(initialState);
245245

246246
state.setState(sortingState);
247-
gridState = state.getState(false, ['sorting', 'inheritance']) as IGridState;
247+
gridState = state.getState(false, ['sorting', 'rowIslands']) as IGridState;
248248
HelperFunctions.verifySortingExpressions(grid.sortingExpressions, gridState);
249249
const gridsCollection = HelperFunctions.getChildGridsCollection(grid, gridState);
250250
gridsCollection.forEach(childGrid => {
251251
HelperFunctions.verifySortingExpressions(childGrid.grid.sortingExpressions, childGrid.state);
252252
});
253-
gridState = state.getState(true, ['sorting', 'inheritance']);
253+
gridState = state.getState(true, ['sorting', 'rowIslands']);
254254
expect(gridState).toBe(sortingState);
255255
});
256256

@@ -267,17 +267,17 @@ describe('IgxHierarchicalGridState - input properties #hGrid', () => {
267267
const sortingState = HelperFunctions.buildStateString(grid, 'sorting', sorting, sorting);
268268
const sortingStateObject = JSON.parse(sortingState) as IGridState;
269269

270-
let gridState = state.getState(true, ['sorting', 'inheritance']);
270+
let gridState = state.getState(true, ['sorting', 'rowIslands']);
271271
expect(gridState).toBe(initialState);
272272

273273
state.setState(sortingStateObject);
274-
gridState = state.getState(false, ['sorting', 'inheritance']);
274+
gridState = state.getState(false, ['sorting', 'rowIslands']);
275275
HelperFunctions.verifySortingExpressions(grid.sortingExpressions, gridState as IGridState);
276276
const gridsCollection = HelperFunctions.getChildGridsCollection(grid, gridState);
277277
gridsCollection.forEach(childGrid => {
278278
HelperFunctions.verifySortingExpressions(childGrid.grid.sortingExpressions, childGrid.state);
279279
});
280-
gridState = state.getState(true, ['sorting', 'inheritance']);
280+
gridState = state.getState(true, ['sorting', 'rowIslands']);
281281
expect(gridState).toBe(sortingState);
282282
});
283283

@@ -287,17 +287,17 @@ describe('IgxHierarchicalGridState - input properties #hGrid', () => {
287287
const initialState = '{"paging":{"index":0,"recordsPerPage":5,"metadata":{"countPages":4,"countRecords":20,"error":0}},"rowIslands":[{"id":"igx-row-island-childData","parentRowID":"0","state":{"paging":{"index":0,"recordsPerPage":5,"metadata":{"countPages":2,"countRecords":7,"error":0}},"rowIslands":[]}},{"id":"igx-row-island-childData","parentRowID":"1","state":{"paging":{"index":0,"recordsPerPage":5,"metadata":{"countPages":3,"countRecords":14,"error":0}},"rowIslands":[]}},{"id":"igx-row-island-childData","parentRowID":"2","state":{"paging":{"index":0,"recordsPerPage":5,"metadata":{"countPages":2,"countRecords":7,"error":0}},"rowIslands":[]}},{"id":"igx-row-island-childData","parentRowID":"3","state":{"paging":{"index":0,"recordsPerPage":5,"metadata":{"countPages":3,"countRecords":14,"error":0}},"rowIslands":[]}},{"id":"igx-row-island-childData","parentRowID":"4","state":{"paging":{"index":0,"recordsPerPage":5,"metadata":{"countPages":2,"countRecords":7,"error":0}},"rowIslands":[]}}]}';
288288
const pagingState = '{"paging":{"index":0,"recordsPerPage":20,"metadata":{"countPages":1,"countRecords":20,"error":0}},"rowIslands":[{"id":"igx-row-island-childData","parentRowID":"0","state":{"paging":{"index":0,"recordsPerPage":20,"metadata":{"countPages":1,"countRecords":7,"error":0}},"rowIslands":[]}},{"id":"igx-row-island-childData","parentRowID":"1","state":{"paging":{"index":0,"recordsPerPage":20,"metadata":{"countPages":1,"countRecords":14,"error":0}},"rowIslands":[]}},{"id":"igx-row-island-childData","parentRowID":"2","state":{"paging":{"index":0,"recordsPerPage":20,"metadata":{"countPages":1,"countRecords":7,"error":0}},"rowIslands":[]}},{"id":"igx-row-island-childData","parentRowID":"3","state":{"paging":{"index":0,"recordsPerPage":20,"metadata":{"countPages":1,"countRecords":14,"error":0}},"rowIslands":[]}},{"id":"igx-row-island-childData","parentRowID":"4","state":{"paging":{"index":0,"recordsPerPage":20,"metadata":{"countPages":1,"countRecords":7,"error":0}},"rowIslands":[]}},{"id":"igx-row-island-childData","parentRowID":"5","state":{"paging":{"index":0,"recordsPerPage":5,"metadata":{"countPages":3,"countRecords":14,"error":0}},"rowIslands":[]}},{"id":"igx-row-island-childData","parentRowID":"6","state":{"paging":{"index":0,"recordsPerPage":5,"metadata":{"countPages":2,"countRecords":7,"error":0}},"rowIslands":[]}}]}';
289289

290-
let gridState = state.getState(true, ['paging', 'inheritance']);
290+
let gridState = state.getState(true, ['paging', 'rowIslands']);
291291
expect(gridState).toBe(initialState);
292292

293293
state.setState(pagingState);
294-
gridState = state.getState(false, ['paging', 'inheritance']);
294+
gridState = state.getState(false, ['paging', 'rowIslands']);
295295
HelperFunctions.verifyPaging(grid.pagingState, gridState as IGridState);
296296
const gridsCollection = HelperFunctions.getChildGridsCollection(grid, gridState);
297297
gridsCollection.forEach(childGrid => {
298298
HelperFunctions.verifyPaging(childGrid.grid.pagingState, childGrid.state);
299299
});
300-
gridState = state.getState(true, ['paging', 'inheritance']);
300+
gridState = state.getState(true, ['paging', 'rowIslands']);
301301
expect(gridState).toBe(pagingState);
302302
});
303303

@@ -309,18 +309,18 @@ describe('IgxHierarchicalGridState - input properties #hGrid', () => {
309309
const filtering = '{"filteringOperands":[{"fieldName":"ProductName","condition":{"name":"contains","isUnary":false,"iconName":"contains"},"searchVal":"A0","ignoreCase":true},{"fieldName":"ID","condition":{"name":"lessThan","isUnary":false,"iconName":"less_than"},"searchVal":3,"ignoreCase":true}],"operator":0,"type":1}';
310310
const filteringState = HelperFunctions.buildStateString(grid, 'advancedFiltering', filtering, filtering);
311311

312-
let gridState = state.getState(true, ['advancedFiltering', 'inheritance']);
312+
let gridState = state.getState(true, ['advancedFiltering', 'rowIslands']);
313313
expect(gridState).toBe(initialState);
314314

315315
state.setState(filteringState);
316-
gridState = state.getState(false, ['advancedFiltering', 'inheritance']) as IGridState;
316+
gridState = state.getState(false, ['advancedFiltering', 'rowIslands']) as IGridState;
317317
HelperFunctions.verifyAdvancedFilteringExpressions(grid.advancedFilteringExpressionsTree, gridState);
318318
const gridsCollection = HelperFunctions.getChildGridsCollection(grid, gridState);
319319
gridsCollection.forEach(childGrid => {
320320
HelperFunctions.verifyAdvancedFilteringExpressions(childGrid.grid.advancedFilteringExpressionsTree, childGrid.state);
321321
});
322322

323-
gridState = state.getState(true, ['advancedFiltering', 'inheritance']);
323+
gridState = state.getState(true, ['advancedFiltering', 'rowIslands']);
324324
expect(gridState).toBe(filteringState);
325325
});
326326

@@ -333,17 +333,17 @@ describe('IgxHierarchicalGridState - input properties #hGrid', () => {
333333
const filteringState = HelperFunctions.buildStateString(grid, 'advancedFiltering', filtering, filtering);
334334
const filteringStateObject = JSON.parse(filteringState) as IGridState;
335335

336-
let gridState = state.getState(true, ['advancedFiltering', 'inheritance']);
336+
let gridState = state.getState(true, ['advancedFiltering', 'rowIslands']);
337337
expect(gridState).toBe(initialState);
338338

339339
state.setState(filteringStateObject);
340-
gridState = state.getState(false, ['advancedFiltering', 'inheritance']) as IGridState;
340+
gridState = state.getState(false, ['advancedFiltering', 'rowIslands']) as IGridState;
341341
HelperFunctions.verifyAdvancedFilteringExpressions(grid.advancedFilteringExpressionsTree, gridState);
342342
const gridsCollection = HelperFunctions.getChildGridsCollection(grid, gridState);
343343
gridsCollection.forEach(childGrid => {
344344
HelperFunctions.verifyAdvancedFilteringExpressions(childGrid.grid.advancedFilteringExpressionsTree, childGrid.state);
345345
});
346-
gridState = state.getState(true, ['advancedFiltering', 'inheritance']);
346+
gridState = state.getState(true, ['advancedFiltering', 'rowIslands']);
347347
expect(gridState).toBe(filteringState);
348348
});
349349

@@ -356,17 +356,17 @@ describe('IgxHierarchicalGridState - input properties #hGrid', () => {
356356
const cellSelection = '[{"rowStart":0,"rowEnd":2,"columnStart":1,"columnEnd":3}]';
357357
const cellSelectionState = HelperFunctions.buildStateString(grid, 'cellSelection', cellSelection, cellSelection);
358358

359-
let gridState = state.getState(true, ['cellSelection', 'inheritance']);
359+
let gridState = state.getState(true, ['cellSelection', 'rowIslands']);
360360
expect(gridState).toBe(initialState);
361361

362362
state.setState(cellSelectionState);
363-
gridState = state.getState(false, ['cellSelection', 'inheritance']);
363+
gridState = state.getState(false, ['cellSelection', 'rowIslands']);
364364
HelperFunctions.verifyCellSelection(grid.getSelectedRanges(), gridState as IGridState);
365365
const gridsCollection = HelperFunctions.getChildGridsCollection(grid, gridState);
366366
gridsCollection.forEach(childGrid => {
367367
HelperFunctions.verifyCellSelection(childGrid.grid.getSelectedRanges(), childGrid.state);
368368
});
369-
gridState = state.getState(true, ['cellSelection', 'inheritance']);
369+
gridState = state.getState(true, ['cellSelection', 'rowIslands']);
370370
expect(gridState).toBe(cellSelectionState);
371371
});
372372

@@ -379,17 +379,17 @@ describe('IgxHierarchicalGridState - input properties #hGrid', () => {
379379
const childRowSelection = '["00","01"]';
380380
const rowSelectionState = HelperFunctions.buildStateString(grid, 'rowSelection', rowSelection, childRowSelection);
381381

382-
let gridState = state.getState(true, ['rowSelection', 'inheritance']);
382+
let gridState = state.getState(true, ['rowSelection', 'rowIslands']);
383383
expect(gridState).toBe(initialState);
384384

385385
state.setState(rowSelectionState);
386-
gridState = state.getState(false, ['rowSelection', 'inheritance']);
386+
gridState = state.getState(false, ['rowSelection', 'rowIslands']);
387387
HelperFunctions.verifyRowSelection(grid.selectedRows(), gridState as IGridState);
388388
const gridsCollection = HelperFunctions.getChildGridsCollection(grid, gridState);
389389
gridsCollection.forEach(childGrid => {
390390
HelperFunctions.verifyRowSelection(childGrid.grid.selectedRows(), childGrid.state);
391391
});
392-
gridState = state.getState(true, ['rowSelection', 'inheritance']);
392+
gridState = state.getState(true, ['rowSelection', 'rowIslands']);
393393
expect(gridState).toBe(rowSelectionState);
394394
});
395395

@@ -405,18 +405,18 @@ describe('IgxHierarchicalGridState - input properties #hGrid', () => {
405405
const childExpansion = '[["00",true]]';
406406
let expansionState = HelperFunctions.buildStateString(grid, 'expansion', expansion, childExpansion, emptyExpansionState);
407407

408-
let gridState = state.getState(true, ['expansion', 'inheritance']);
408+
let gridState = state.getState(true, ['expansion', 'rowIslands']);
409409
expect(gridState).toBe(initialState);
410410

411411
state.setState(expansionState);
412412
expansionState = HelperFunctions.buildStateString(grid, 'expansion', expansion, childExpansion, emptyExpansionState);
413-
gridState = state.getState(false, ['expansion', 'inheritance']);
413+
gridState = state.getState(false, ['expansion', 'rowIslands']);
414414
HelperFunctions.verifyExpansionStates(grid.expansionStates, gridState as IGridState);
415415
const gridsCollection = HelperFunctions.getChildGridsCollection(grid, gridState);
416416
gridsCollection.forEach(childGrid => {
417417
HelperFunctions.verifyExpansionStates(childGrid.grid.expansionStates, childGrid.state);
418418
});
419-
gridState = state.getState(true, ['expansion', 'inheritance']);
419+
gridState = state.getState(true, ['expansion', 'rowIslands']);
420420
expect(gridState).toBe(expansionState);
421421
});
422422

@@ -430,20 +430,20 @@ describe('IgxHierarchicalGridState - input properties #hGrid', () => {
430430
const newColumns = '[{"pinned":false,"sortable":true,"filterable":false,"editable":true,"sortingIgnoreCase":true,"filteringIgnoreCase":true,"headerClasses":"","headerGroupClasses":"","groupable":false,"movable":false,"hidden":false,"dataType":"string","hasSummary":false,"field":"ProductName","width":"363px","header":"Product Name","resizable":false,"searchable":true},{"pinned":false,"sortable":false,"filterable":true,"editable":false,"sortingIgnoreCase":true,"filteringIgnoreCase":true,"headerClasses":"","headerGroupClasses":"","groupable":false,"movable":false,"hidden":false,"dataType":"number","hasSummary":false,"field":"ID","width":"363px","header":"ID","resizable":false,"searchable":true}]';
431431
const newColumnsState = HelperFunctions.buildStateString(grid, 'columns', newColumns, newColumns);
432432

433-
let gridState = state.getState(true, ['columns', 'inheritance']);
433+
let gridState = state.getState(true, ['columns', 'rowIslands']);
434434
expect(gridState).toBe(initialState);
435435

436436
state.setState(newColumnsState);
437437
await wait();
438438
fix.detectChanges();
439439

440-
gridState = state.getState(false, ['columns', 'inheritance']) as IGridState;
440+
gridState = state.getState(false, ['columns', 'rowIslands']) as IGridState;
441441
HelperFunctions.verifyColumns(JSON.parse(newColumnsState).columns, gridState);
442442
// const gridsCollection = HelperFunctions.getChildGridsCollection(grid, gridState);
443443
// gridsCollection.forEach(childGrid => {
444444
// HelperFunctions.verifyColumns(childGrid.grid.columns, childGrid.state);
445445
// });
446-
// gridState = state.getState(true, ['columns', 'inheritance']);
446+
// gridState = state.getState(true, ['columns', 'rowIslands']);
447447
// expect(gridState).toBe(newColumnsState);
448448
});
449449
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('IgxTreeGridState - input properties #tGrid', () => {
4545
cellSelection: true,
4646
rowSelection: true,
4747
columnSelection: true,
48-
inheritance: true,
48+
rowIslands: true,
4949
expansion: true
5050
};
5151

0 commit comments

Comments
 (0)