Skip to content

Commit a5a34e3

Browse files
committed
fix(cd): additional migration fixes
1 parent 0351660 commit a5a34e3

File tree

12 files changed

+66
-51
lines changed

12 files changed

+66
-51
lines changed

projects/igniteui-angular/grids/core/src/grid-actions/grid-pinning-actions.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ class IgxActionStripTestingComponent implements OnInit {
122122
@ViewChild('grid', { read: IgxGridComponent, static: true })
123123
public grid: IgxGridComponent;
124124

125-
private data: any[];
126-
private columns: any[];
125+
public data: any[];
126+
public columns: any[];
127127

128128
public ngOnInit() {
129129

projects/igniteui-angular/grids/core/src/services/excel/excel-exporter-grid.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ describe('Excel Exporter', () => {
944944
hGrid = fix.componentInstance.hGrid;
945945
options = createExportOptions('HierarchicalGridEmptyDataExcelExport');
946946

947-
await expectAsync(getExportedData(hGrid, options)).toBeResolved();
947+
await expect(getExportedData(hGrid, options)).resolves.toBeDefined();
948948
});
949949

950950
it('should export hierarchical grid with empty data and summaries without throwing error', async () => {
@@ -959,7 +959,7 @@ describe('Excel Exporter', () => {
959959
options = createExportOptions('HierarchicalGridEmptyDataWithSummariesExcelExport');
960960
options.exportSummaries = true;
961961

962-
await expectAsync(getExportedData(hGrid, options)).toBeResolved();
962+
await expect(getExportedData(hGrid, options)).resolves.toBeDefined();
963963
});
964964

965965
it('should export hierarchical grid with missing child data key without throwing error', async () => {
@@ -969,7 +969,7 @@ describe('Excel Exporter', () => {
969969
hGrid = fix.componentInstance.hGrid;
970970
options = createExportOptions('HierarchicalGridMissingChildDataExcelExport');
971971

972-
await expectAsync(getExportedData(hGrid, options)).toBeResolved();
972+
await expect(getExportedData(hGrid, options)).resolves.toBeDefined();
973973
});
974974
});
975975

projects/igniteui-angular/grids/core/src/services/excel/zip-verification-wrapper.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class ZipWrapper {
2828
result && ObjectComparer.AreEqual(this.dataFilesAndFolders, template) :
2929
result && this._filesAndFolders.length === ZipFiles.templatesNames.length;
3030

31-
expect(result).toBe(true, message + ' Unexpected zip structure!');
31+
expect(result, message + ' Unexpected zip structure!').toBe(true);
3232
}
3333

3434
/* Verifies the contents of all template files and asserts the result.
@@ -41,7 +41,7 @@ export class ZipWrapper {
4141

4242
await this.readTemplateFiles().then(() => {
4343
result = this.compareFiles(this.templateFilesContent, undefined);
44-
expect(result.areEqual).toBe(true, msg + result.differences);
44+
expect(result.areEqual, msg + result.differences).toBe(true);
4545
});
4646
}
4747

@@ -53,7 +53,7 @@ export class ZipWrapper {
5353

5454
await this.readDataFiles().then(() => {
5555
result = this.compareFiles(this.dataFilesContent, expectedData, isHGrid);
56-
expect(result.areEqual).toBe(true, msg + result.differences);
56+
expect(result.areEqual, msg + result.differences).toBe(true);
5757
});
5858
}
5959

projects/igniteui-angular/grids/core/src/services/pdf/pdf-exporter-grid.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -490,14 +490,14 @@ describe('PDF Grid Exporter', () => {
490490
it('should export hierarchical pivot grid', async () => {
491491
fix = TestBed.createComponent(IgxPivotGridTestComplexHierarchyComponent);
492492
fix.detectChanges();
493-
fix.whenStable().then(() => {
494-
pivotGrid = fix.componentInstance.pivotGrid;
493+
await fix.whenStable();
494+
495+
pivotGrid = fix.componentInstance.pivotGrid;
495496

496-
const exportPromise = firstValueFrom(exporter.exportEnded);
497-
exporter.export(pivotGrid, options);
498-
await exportPromise;
499-
expect(ExportUtilities.saveBlobToFile).toHaveBeenCalledTimes(1);
500-
});
497+
const exportPromise = firstValueFrom(exporter.exportEnded);
498+
exporter.export(pivotGrid, options);
499+
await exportPromise;
500+
expect(ExportUtilities.saveBlobToFile).toHaveBeenCalledTimes(1);
501501
});
502502
});
503503
});

projects/igniteui-angular/grids/grid/src/column.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,11 +1647,11 @@ describe('IgxGrid - Column properties #grid', () => {
16471647
.filter(attr => Boolean(attr));
16481648

16491649
for (const attr of gridAttributes) {
1650-
expect(grid[attr]).toBe(true, `Grid attribute: '${attr}' failed`);
1650+
expect(grid[attr], `Grid attribute: '${attr}' failed`).toBe(true);
16511651
}
16521652

16531653
for (const attr of columnAttributes) {
1654-
expect(column[attr]).toBe(true, `Column attribute: '${attr}' failed`);
1654+
expect(column[attr], `Column attribute: '${attr}' failed`).toBe(true);
16551655
}
16561656
}))
16571657
});

projects/igniteui-angular/grids/grid/src/grid-filtering-ui.spec.ts

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,7 +2047,7 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
20472047
// Verify the condition was submitted.
20482048
const header = GridFunctions.getColumnHeader('ProductName', fix);
20492049
const activeFilterIcon = header.nativeElement.querySelector('.igx-excel-filter__icon--filtered');
2050-
expect(activeFilterIcon).toBeDefined('no active filter icon was found');
2050+
expect(activeFilterIcon, 'no active filter icon was found').toBeDefined();
20512051
}));
20522052

20532053
it('Should clear non-unary conditions with null searchVal when close', fakeAsync(() => {
@@ -2842,24 +2842,23 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
28422842

28432843
it('Should render custom filter template instead of default one.', fakeAsync(() => {
28442844
// Verify default filter template is not present.
2845-
expect(GridFunctions.getFilterCell(fix, 'ProductName').query(By.css('.igx-filtering-chips'))).toBeNull(
2846-
'\'ProductName\' default filter chips area template was found.');
2847-
expect(GridFunctions.getFilterCell(fix, 'Downloads').query(By.css('.igx-filtering-chips'))).toBeNull(
2848-
'\'Downloads\' default filter chips area template was found.');
2849-
expect(GridFunctions.getFilterCell(fix, 'Released').query(By.css('.igx-filtering-chips'))).toBeNull(
2850-
'\'Released\' default filter chips area template was found.');
2851-
expect(GridFunctions.getFilterCell(fix, 'ReleaseDate').query(By.css('.igx-filtering-chips'))).toBeNull(
2852-
'\'ReleaseDate\' default filter chips area template was found.');
2853-
2845+
expect(GridFunctions.getFilterCell(fix, 'ProductName').query(By.css('.igx-filtering-chips')),
2846+
'\'ProductName\' default filter chips area template was found.').toBeNull();
2847+
expect(GridFunctions.getFilterCell(fix, 'Downloads').query(By.css('.igx-filtering-chips')),
2848+
'\'Downloads\' default filter chips area template was found.').toBeNull();
2849+
expect(GridFunctions.getFilterCell(fix, 'Released').query(By.css('.igx-filtering-chips')),
2850+
'\'Released\' default filter chips area template was found.').toBeNull();
2851+
expect(GridFunctions.getFilterCell(fix, 'ReleaseDate').query(By.css('.igx-filtering-chips')),
2852+
'\'ReleaseDate\' default filter chips area template was found.').toBeNull();
28542853
// Verify the custom filter template is present.
2855-
expect(GridFunctions.getFilterCell(fix, 'ProductName').query(By.css('.custom-filter'))).not.toBeNull(
2856-
'\'ProductName\' customer filter template was not found.');
2857-
expect(GridFunctions.getFilterCell(fix, 'Downloads').query(By.css('.custom-filter'))).not.toBeNull(
2858-
'\'Downloads\' customer filter template was not found.');
2859-
expect(GridFunctions.getFilterCell(fix, 'Released').query(By.css('.custom-filter'))).not.toBeNull(
2860-
'\'Released\' customer filter template was not found.');
2861-
expect(GridFunctions.getFilterCell(fix, 'ReleaseDate').query(By.css('.custom-filter'))).not.toBeNull(
2862-
'\'ReleaseDate\' customer filter template was not found.');
2854+
expect(GridFunctions.getFilterCell(fix, 'ProductName').query(By.css('.custom-filter')),
2855+
'\'ProductName\' customer filter template was not found.').not.toBeNull();
2856+
expect(GridFunctions.getFilterCell(fix, 'Downloads').query(By.css('.custom-filter')),
2857+
'\'Downloads\' customer filter template was not found.').not.toBeNull();
2858+
expect(GridFunctions.getFilterCell(fix, 'Released').query(By.css('.custom-filter')),
2859+
'\'Released\' customer filter template was not found.').not.toBeNull();
2860+
expect(GridFunctions.getFilterCell(fix, 'ReleaseDate').query(By.css('.custom-filter')),
2861+
'\'ReleaseDate\' customer filter template was not found.').not.toBeNull();
28632862
}));
28642863

28652864
it('Should close default filter template when clicking on a column with custom one.', fakeAsync(() => {
@@ -6176,7 +6175,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
61766175

61776176
excelMenu = GridFunctions.getExcelStyleFilteringComponent(fix);
61786177
expect(excelMenu).not.toBeNull();
6179-
expect(inputNativeElement.value).toBe('', 'input isn\'t cleared correctly');
6178+
expect(inputNativeElement.value, 'input isn\'t cleared correctly').toBe('');
61806179
}));
61816180

61826181
it('Should clear search criteria when selecting clear column filters option.', fakeAsync(() => {
@@ -6615,7 +6614,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
66156614
flush();
66166615

66176616
inputNativeElement = GridFunctions.getExcelStyleSearchComponentInput(fix);
6618-
expect(inputNativeElement.value).toBe('', 'input value didn\'t reset');
6617+
expect(inputNativeElement.value, 'input value didn\'t reset').toBe('');
66196618
}));
66206619

66216620
it('Should reset blank items on column change.', fakeAsync(() => {
@@ -7429,8 +7428,7 @@ const verifyPinningHidingSize = (fix: ComponentFixture<any>, expectedSize: ɵSiz
74297428
expect(actionsAreaColumnHidingIcon, 'actionsArea column hiding icon is NOT present').not.toBeNull();
74307429
} else {
74317430
// Verify icons in header are present.
7432-
expect((headerAreaPinIcon !== null) || (headerAreaUnpinIcon !== null)).toBe(true,
7433-
'headerArea pin/unpin icon is NOT present');
7431+
expect((headerAreaPinIcon !== null) || (headerAreaUnpinIcon !== null), 'headerArea pin/unpin icon is NOT present').toBe(true);
74347432
expect(headerAreaColumnHidingIcon, 'headerArea column hiding icon is NOT present').not.toBeNull();
74357433
// Verify icons in actions area are not present.
74367434
expect(actionsPinArea, 'actionsArea pin icon is present').toBeNull();

projects/igniteui-angular/test-utils/grid-samples.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ export class GridPinningMRLComponent extends PinOnInitAndSelectionComponent {
269269
}
270270

271271
@Component({
272-
template: GridTemplateStrings.declareGrid(` [height]="height" [width]="width"`,
272+
template: GridTemplateStrings.declareGrid(` height="height" width="width"`,
273273
`${EventSubscriptions.selected}${EventSubscriptions.columnPin}`,
274274
ColumnDefinitions.generatedWithWidth),
275275
imports: [IgxGridComponent, IgxColumnComponent]

projects/igniteui-angular/tree/src/tree/tree-functions.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class TreeTestFunctions {
8787
allChildren?: any[]
8888
): IgxTreeNodeComponent<any>[] {
8989
const nodesArr = [];
90-
const mockEmitter: EventEmitter<boolean> = { emit: vi.fn() };
90+
const mockEmitter: EventEmitter<boolean> = { emit: vi.fn() } as unknown as EventEmitter<boolean>;
9191
for (let i = 0; i < count; i++) {
9292
nodesArr.push(this.createNodeSpy({
9393
level,

projects/igniteui-angular/tree/src/tree/tree-navigation.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,8 @@ describe('IgxTree - Navigation #treeView', () => {
636636

637637
describe('IgxNavigationService', () => {
638638
beforeEach(() => {
639-
mockEmitter = { emit: vi.fn() };
640-
mockTree = { selection: IgxTreeSelectionType.BiState, activeNodeChanged: mockEmitter, nodes: mockQuery1 };
639+
mockEmitter = { emit: vi.fn() } as unknown as EventEmitter<IgxTreeNode<any>>;
640+
mockTree = { selection: IgxTreeSelectionType.BiState, activeNodeChanged: mockEmitter, nodes: mockQuery1 } as unknown as IgxTreeComponent;
641641

642642
TestBed.configureTestingModule({
643643
providers: [

projects/igniteui-angular/tree/src/tree/tree-selection.service.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ describe('IgxTreeSelectionService - Unit Tests #treeView', () => {
5555

5656
describe('IgxTreeSelectionService - BiState & None', () => {
5757
beforeEach(() => {
58-
mockEmitter = { emit: vi.fn() };
59-
mockTree = { selection: IgxTreeSelectionType.BiState, nodeSelection: mockEmitter, nodes: mockQuery1 };
58+
mockEmitter = { emit: vi.fn() } as unknown as EventEmitter<ITreeNodeSelectionEvent>;
59+
mockTree = { selection: IgxTreeSelectionType.BiState, nodeSelection: mockEmitter, nodes: mockQuery1 } as unknown as IgxTree;
6060
selectionService.register(mockTree);
6161
});
6262

@@ -96,7 +96,7 @@ describe('IgxTreeSelectionService - Unit Tests #treeView', () => {
9696
});
9797

9898
it('Should handle selection based on tree.selection', () => {
99-
const mockSelectedChangeEmitter: EventEmitter<boolean> = { emit: vi.fn() };
99+
const mockSelectedChangeEmitter: EventEmitter<boolean> = { emit: vi.fn() } as unknown as EventEmitter<boolean>;
100100
const mockNode = TreeTestFunctions.createNodeSpy({ selectedChange: mockSelectedChangeEmitter });
101101

102102
// None
@@ -147,7 +147,7 @@ describe('IgxTreeSelectionService - Unit Tests #treeView', () => {
147147
});
148148

149149
it('Should deselect nodes', () => {
150-
const mockSelectedChangeEmitter: EventEmitter<boolean> = { emit: vi.fn() };
150+
const mockSelectedChangeEmitter: EventEmitter<boolean> = { emit: vi.fn() } as unknown as EventEmitter<boolean>;
151151
const mockNode1 = TreeTestFunctions.createNodeSpy({ selectedChange: mockSelectedChangeEmitter });
152152
const mockNode2 = TreeTestFunctions.createNodeSpy({ selectedChange: mockSelectedChangeEmitter });
153153

0 commit comments

Comments
 (0)