Skip to content

Commit c3ef169

Browse files
committed
chore(*): some refactoring
1 parent d47e8fd commit c3ef169

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,10 +1128,10 @@ export class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirecti
11281128
}
11291129

11301130

1131-
private hg_verticalScrollHandler(event) {
1131+
private hg_verticalScrollHandler() {
11321132
this.scrollTop = this.verticalScrollContainer.scrollPosition;
11331133
}
1134-
private hg_horizontalScrollHandler(event) {
1134+
private hg_horizontalScrollHandler() {
11351135
this.scrollLeft = this.headerContainer.scrollPosition;
11361136
}
11371137
}

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { GridSelectionMode } from '../common/enums';
1515
import { GridFunctions } from '../../test-utils/grid-functions.spec';
1616
import { IgxGridCellComponent } from '../cell.component';
1717

18-
describe('Basic IgxHierarchicalGrid', () => {
18+
describe('Basic IgxHierarchicalGrid #hGrid', () => {
1919
configureTestSuite();
2020

2121
beforeAll(waitForAsync(() => {
@@ -1583,7 +1583,7 @@ describe('Basic IgxHierarchicalGrid', () => {
15831583
describe('Columns and row islands runtime change', () => {
15841584
let fixture: ComponentFixture<IgxHierarchicalGridToggleRIAndColsComponent>;
15851585
let hierarchicalGrid: IgxHierarchicalGridComponent;
1586-
1586+
15871587
it('should allow changing columns runtime in root grid when there are no row islands.', fakeAsync(() => {
15881588
fixture = TestBed.createComponent(IgxHierarchicalGridToggleRIAndColsComponent);
15891589
fixture.detectChanges();
@@ -1593,7 +1593,7 @@ describe('Basic IgxHierarchicalGrid', () => {
15931593
fixture.componentInstance.toggleColumns = true;
15941594
fixture.detectChanges();
15951595
tick();
1596-
1596+
15971597
expect(hierarchicalGrid.columns.length).toBe(2);
15981598

15991599
fixture.componentInstance.toggleRI = true;
@@ -1680,7 +1680,7 @@ describe('Basic IgxHierarchicalGrid', () => {
16801680
expect(gridCellValues.length).toBe(1);
16811681
}));
16821682
});
1683-
1683+
16841684
});
16851685

16861686
@Component({

projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('IgxPivotGrid #pivotGrid', () => {
3939
}));
4040

4141
describe('Basic IgxPivotGrid #pivotGrid', () => {
42-
let fixture;
42+
let fixture: ComponentFixture<IgxPivotGridTestBaseComponent>;
4343

4444
beforeEach(waitForAsync(() => {
4545
fixture = TestBed.createComponent(IgxPivotGridTestBaseComponent);
@@ -214,7 +214,7 @@ describe('IgxPivotGrid #pivotGrid', () => {
214214
fixture.detectChanges();
215215
expect(pivotGrid.pivotConfiguration.values[1].enabled).toBeFalse();
216216
expect(pivotGrid.values.length).toBe(0);
217-
expect(pivotGrid.columns.length).toBe(3)
217+
expect(pivotGrid.columns.length).toBe(3);
218218
});
219219

220220
it('should remove filter dimension from chip', () => {
@@ -271,7 +271,8 @@ describe('IgxPivotGrid #pivotGrid', () => {
271271
memberName: 'Country',
272272
enabled: true
273273
}
274-
]
274+
],
275+
values: null
275276
};
276277
pivotGrid.pipeTrigger++;
277278
pivotGrid.setupColumns();
@@ -1127,7 +1128,7 @@ describe('IgxPivotGrid #pivotGrid', () => {
11271128
expected = ['Uruguay', 'USA', 'Bulgaria'];
11281129
expect(colHeaders).toEqual(expected);
11291130
const expectedExpressions: ISortingExpression[] = [
1130-
{ dir: SortingDirection.None, fieldName: 'All', strategy: DefaultPivotSortingStrategy.instance()},
1131+
{ dir: SortingDirection.None, fieldName: 'All', strategy: DefaultPivotSortingStrategy.instance()},
11311132
{ dir: SortingDirection.None, fieldName: 'ProductCategory', strategy: DefaultPivotSortingStrategy.instance()},
11321133
{ dir: SortingDirection.Desc, fieldName: 'Country', strategy: DefaultPivotSortingStrategy.instance() }
11331134
];
@@ -1140,7 +1141,6 @@ describe('IgxPivotGrid #pivotGrid', () => {
11401141
pivotGrid.pivotConfiguration.columns = [{
11411142
memberName: 'Country',
11421143
memberFunction: (data) => {
1143-
const len = data['Country'].length;
11441144
return data['Country'];
11451145
},
11461146
enabled: true
@@ -1167,7 +1167,7 @@ describe('IgxPivotGrid #pivotGrid', () => {
11671167
expected = ['Uruguay', 'USA', 'Bulgaria'];
11681168
expect(colHeaders).toEqual(expected);
11691169
const expectedExpressions: ISortingExpression[] = [
1170-
{ dir: SortingDirection.None, fieldName: 'All', strategy: DefaultPivotSortingStrategy.instance()},
1170+
{ dir: SortingDirection.None, fieldName: 'All', strategy: DefaultPivotSortingStrategy.instance()},
11711171
{ dir: SortingDirection.None, fieldName: 'ProductCategory', strategy: DefaultPivotSortingStrategy.instance()},
11721172
{ dir: SortingDirection.Desc, fieldName: 'Country', strategy: DefaultPivotSortingStrategy.instance() }
11731173
];
@@ -1830,7 +1830,7 @@ describe('IgxPivotGrid #pivotGrid', () => {
18301830
});
18311831

18321832
describe('IgxPivotGrid complex hierarchy #pivotGrid', () => {
1833-
let fixture;
1833+
let fixture: ComponentFixture<IgxPivotGridTestComplexHierarchyComponent>;
18341834

18351835
beforeEach(waitForAsync(() => {
18361836
fixture = TestBed.createComponent(IgxPivotGridTestComplexHierarchyComponent);

projects/igniteui-angular/src/lib/test-utils/grid-functions.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { IgxRowDirective } from '../grids/row.directive';
2323
import { CellType, GridType, RowType } from '../grids/common/grid.interface';
2424
import { IgxTreeNodeComponent } from '../tree/tree-node/tree-node.component';
2525
import { IgxColumnComponent } from '../grids/columns/column.component';
26+
import { IgxPivotGridComponent } from '../grids/pivot-grid/pivot-grid.component';
2627

2728

2829
const SUMMARY_LABEL_CLASS = '.igx-grid-summary__label';
@@ -149,7 +150,7 @@ export class GridFunctions {
149150
return row.query(By.css(DISPLAY_CONTAINER));
150151
}
151152

152-
public static getColGroup(grid: IgxGridComponent, headerName: string): IgxColumnGroupComponent {
153+
public static getColGroup(grid: IgxGridComponent | IgxPivotGridComponent, headerName: string): IgxColumnGroupComponent {
153154
const colGroups = grid.columns.filter(c => c.columnGroup && c.header === headerName);
154155
if (colGroups.length === 0) {
155156
return null;
@@ -2030,7 +2031,7 @@ export class GridFunctions {
20302031
const groupBlock = mrlBlocks[index] as any;
20312032
const cellsFromBlock = firstRowCells.filter((cell) => cell.nativeElement.parentNode === groupBlock);
20322033
expect(groupBlock).not.toBeNull();
2033-
groupSetting.columns.forEach((col, colIndex) => {
2034+
groupSetting.columns.forEach((col) => {
20342035
const cell = cellsFromBlock.find(x => x.column.field == col.field) as any;
20352036
const cellElem = cell.nativeElement;
20362037
// check correct attributes are applied

0 commit comments

Comments
 (0)