Skip to content

Commit 5b40832

Browse files
committed
refactor(*): change tests to account for new DI
1 parent ce346e7 commit 5b40832

File tree

9 files changed

+45
-10
lines changed

9 files changed

+45
-10
lines changed

projects/igniteui-angular/src/lib/grids/grid/grid.multi-row-layout.integration.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { IgxGridToolbarComponent } from '../toolbar/grid-toolbar.component';
1414
import { IgxGridToolbarActionsComponent } from '../toolbar/common';
1515
import { IgxGridToolbarHidingComponent } from '../toolbar/grid-toolbar-hiding.component';
1616
import { IgxGridToolbarPinningComponent } from '../toolbar/grid-toolbar-pinning.component';
17+
import { IgxGridMRLNavigationService } from '../grid-mrl-navigation.service';
1718

1819

1920
type FixtureType = ColumnLayoutGroupingTestComponent | ColumnLayoutHidingTestComponent | ColumnLayoutResizingTestComponent
@@ -39,6 +40,9 @@ describe('IgxGrid - multi-row-layout Integration #grid - ', () => {
3940
ColumnLayoutHidingTestComponent,
4041
ColumnLayoutGroupingTestComponent,
4142
ColumnLayoutResizingTestComponent
43+
],
44+
providers: [
45+
IgxGridMRLNavigationService
4246
]
4347
}).compileComponents();
4448
}));

projects/igniteui-angular/src/lib/grids/grid/row-drag.directive.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { SortingDirection } from '../../data-operations/sorting-strategy';
2222
import { IgxRowDirective } from '../row.directive';
2323
import { NgStyle } from '@angular/common';
2424
import { IgxIconComponent } from '../../icon/icon.component';
25+
import { IgxGridNavigationService } from '../grid-navigation.service';
2526

2627
const DEBOUNCE_TIME = 50;
2728
const CSS_CLASS_DRAG_INDICATOR = '.igx-grid__drag-indicator';
@@ -954,6 +955,9 @@ describe('Row Drag Tests', () => {
954955
NoopAnimationsModule,
955956
IgxHierarchicalGridTestComponent,
956957
IgxHierarchicalGridCustomGhostTestComponent
958+
],
959+
providers: [
960+
IgxGridNavigationService
957961
]
958962
}).compileComponents();
959963
}));

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { clearGridSubs, setupHierarchicalGridScrollDetection } from '../../test-
1010
import { GridFunctions } from '../../test-utils/grid-functions.spec';
1111
import { IgxGridCellComponent } from '../cell.component';
1212
import { IGridCellEventArgs, IgxColumnComponent, IPathSegment } from '../public_api';
13+
import { IgxGridNavigationService } from '../grid-navigation.service';
1314

1415
const DEBOUNCE_TIME = 50;
1516
const GRID_CONTENT_CLASS = '.igx-grid__tbody-content';
@@ -29,6 +30,9 @@ describe('IgxHierarchicalGrid Navigation', () => {
2930
IgxHierarchicalGridTestComplexComponent,
3031
IgxHierarchicalGridMultiLayoutComponent,
3132
IgxHierarchicalGridSmallerChildComponent
33+
],
34+
providers: [
35+
IgxGridNavigationService
3236
]
3337
}).compileComponents();
3438
jasmine.DEFAULT_TIMEOUT_INTERVAL = defaultTimeout * 2;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,9 @@ describe('IgxHierarchicalGrid Virtualization Custom Scenarios #hGrid', () => {
450450
NoopAnimationsModule,
451451
IgxHierarchicalGridTestBaseComponent,
452452
IgxHierarchicalGridNoScrollTestComponent
453+
],
454+
providers: [
455+
IgxGridNavigationService
453456
]
454457
}).compileComponents();
455458
}));

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

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ import { IgxPivotAutoTransform, IgxPivotColumnPipe, IgxPivotRowExpansionPipe, Ig
66
import { PivotGridFunctions } from '../../test-utils/pivot-grid-functions.spec';
77
import { DATA } from 'src/app/shared/pivot-data';
88
import { DefaultDataCloneStrategy, IDataCloneStrategy } from '../../data-operations/data-clone-strategy';
9+
import { TestBed } from '@angular/core/testing';
10+
import { IGX_GRID_BASE } from '../common/grid.interface';
911

10-
describe('Pivot pipes #pivotGrid', () => {
12+
fdescribe('Pivot pipes #pivotGrid', () => {
1113
let rowPipe: IgxPivotRowPipe;
1214
let rowStatePipe: IgxPivotRowExpansionPipe;
1315
let columnPipe: IgxPivotColumnPipe;
@@ -18,6 +20,8 @@ describe('Pivot pipes #pivotGrid', () => {
1820
let cloneStrategy: IDataCloneStrategy;
1921

2022
beforeEach(() => {
23+
24+
2125
data = [
2226
{
2327
ProductCategory: 'Clothing', UnitPrice: 12.81, SellerName: 'Stanley',
@@ -65,9 +69,17 @@ describe('Pivot pipes #pivotGrid', () => {
6569
],
6670
filters: null
6771
};
72+
TestBed.configureTestingModule({
73+
providers: [
74+
IgxPivotRowPipe,
75+
IgxPivotRowExpansionPipe,
76+
{ provide: IGX_GRID_BASE, useValue: null },
77+
]
78+
});
79+
6880
expansionStates = new Map<any, boolean>();
69-
rowPipe = new IgxPivotRowPipe();
70-
rowStatePipe = new IgxPivotRowExpansionPipe();
81+
rowPipe = TestBed.inject(IgxPivotRowPipe);
82+
rowStatePipe = TestBed.inject(IgxPivotRowExpansionPipe);
7183
columnPipe = new IgxPivotColumnPipe();
7284
autoTransformPipe = new IgxPivotAutoTransform();
7385
cloneStrategy = new DefaultDataCloneStrategy();
@@ -648,7 +660,7 @@ describe('Pivot pipes #pivotGrid', () => {
648660
let columnPipeResult = columnPipe.transform(rowPipeResult, pivotConfig, cloneStrategy, new Map<any, boolean>());
649661
let rowStatePipeResult = rowStatePipe.transform(columnPipeResult, pivotConfig, expansionStates, true);
650662

651-
const date_prod_seller = PivotGridFunctions.getDimensionValues(rowStatePipeResult);
663+
const date_prod_seller = PivotGridFunctions.getDimensionValues(rowStatePipeResult);
652664
expect(rowStatePipeResult.length).toBe(42);
653665

654666
const allPeriodsRecords = date_prod_seller.filter(x => x['AllPeriods'] === 'All Periods');
@@ -746,7 +758,7 @@ describe('Pivot pipes #pivotGrid', () => {
746758
columnPipeResult = columnPipe.transform(rowPipeResult, pivotConfig, cloneStrategy, new Map<any, boolean>());
747759
rowStatePipeResult = rowStatePipe.transform(columnPipeResult, pivotConfig, expansionStates, true);
748760
expect(rowStatePipeResult.length).toBe(42);
749-
const seller_prod_date = PivotGridFunctions.getDimensionValues(rowStatePipeResult);
761+
const seller_prod_date = PivotGridFunctions.getDimensionValues(rowStatePipeResult);
750762
const stanleyRecords = seller_prod_date.filter(x => x['SellerName'] === 'Stanley');
751763
expect(stanleyRecords).toEqual([
752764
{ SellerName: 'Stanley', AllProduct: 'All Products', AllPeriods: 'All Periods' },

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const CSS_CLASS_LIST = 'igx-drop-down__list';
2929
const CSS_CLASS_ITEM = 'igx-drop-down__item';
3030
const ACTIVE_CELL_CSS_CLASS = '.igx-grid-th--active';
3131

32-
fdescribe('IgxPivotGrid #pivotGrid', () => {
32+
describe('IgxPivotGrid #pivotGrid', () => {
3333

3434
beforeEach(waitForAsync(() => {
3535
TestBed.configureTestingModule({

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,18 @@ import { GridSelectionRange } from './common/types';
1515
import { IgxColumnComponent } from './public_api';
1616
import { IgxPaginatorComponent } from '../paginator/paginator.component';
1717
import { IColumnState, IGridState } from './state-base.directive';
18+
import { IgxGridNavigationService } from './grid-navigation.service';
1819

1920
describe('IgxHierarchicalGridState - input properties #hGrid', () => {
2021
let fix;
2122
let grid;
2223

2324
beforeEach(waitForAsync(() => {
2425
TestBed.configureTestingModule({
25-
imports: [NoopAnimationsModule, IgxHierarchicalGridTestExpandedBaseComponent]
26+
imports: [NoopAnimationsModule, IgxHierarchicalGridTestExpandedBaseComponent],
27+
providers: [
28+
IgxGridNavigationService
29+
]
2630
}).compileComponents();
2731
}))
2832

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@ import { IgxPivotNumericAggregate } from './pivot-grid/pivot-grid-aggregate';
88
import { IgxPivotDateDimension } from './pivot-grid/pivot-grid-dimensions';
99
import { IPivotDimension, IPivotGridRecord } from './pivot-grid/pivot-grid.interface';
1010
import { IgxPivotRowDimensionHeaderComponent } from './pivot-grid/pivot-row-dimension-header.component';
11+
import { IgxGridNavigationService } from './grid-navigation.service';
1112

1213
describe('IgxPivotGridState #pivotGrid :', () => {
1314
let fixture;
1415
let pivotGrid;
1516
beforeEach(waitForAsync(() => {
1617
TestBed.configureTestingModule({
17-
imports: [NoopAnimationsModule, IgxPivotGridPersistanceComponent]
18+
imports: [NoopAnimationsModule, IgxPivotGridPersistanceComponent],
19+
providers: [
20+
IgxGridNavigationService
21+
]
1822
}).compileComponents();
1923
}));
2024

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export class ColumnGroupsHidingTestComponent extends ColumnHidingTestComponent {
230230
constructor() {
231231
const cdr = inject(ChangeDetectorRef);
232232

233-
super(cdr);
233+
super();
234234
}
235235
}
236236

@@ -303,6 +303,6 @@ export class ColumnGroupsPinningTestComponent extends ColumnPinningTestComponent
303303
constructor() {
304304
const cdr = inject(ChangeDetectorRef);
305305

306-
super(cdr);
306+
super();
307307
}
308308
}

0 commit comments

Comments
 (0)