Skip to content

Commit 9006130

Browse files
authored
Merge branch '9.0.x' into nrobakova/refactor-hiding-tests-90
2 parents e602ee6 + 39d47f4 commit 9006130

File tree

10 files changed

+58
-73
lines changed

10 files changed

+58
-73
lines changed

package-lock.json

Lines changed: 19 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@
5353
"@angular/platform-browser-dynamic": "^9.0.0",
5454
"@angular/router": "^9.0.0",
5555
"@types/hammerjs": "^2.0.36",
56+
"@types/jszip": "^3.1.7",
5657
"@types/source-map": "0.5.2",
5758
"classlist.js": "^1.1.20150312",
5859
"core-js": "^2.6.2",
5960
"hammerjs": "^2.0.8",
60-
"jszip": "^3.1.5",
61+
"jszip": "^3.3.0",
6162
"resize-observer-polyfill": "^1.5.1",
6263
"rxjs": "^6.5.4",
6364
"tslib": "^1.10.0",

projects/igniteui-angular/ng-package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
},
88
"whitelistedNonPeerDependencies": [
99
"@types/hammerjs",
10+
"@types/jszip",
1011
"hammerjs",
1112
"jszip",
1213
"resize-observer-polyfill"

projects/igniteui-angular/ng-package.prod.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"whitelistedNonPeerDependencies": [
1212
"@types/hammerjs",
13+
"@types/jszip",
1314
"hammerjs",
1415
"jszip",
1516
"resize-observer-polyfill"

projects/igniteui-angular/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@
6767
],
6868
"dependencies": {
6969
"@types/hammerjs": "^2.0.36",
70+
"@types/jszip": "^3.1.7",
7071
"hammerjs": "^2.0.8",
71-
"jszip": "^3.1.5",
72+
"jszip": "^3.3.0",
7273
"resize-observer-polyfill": "^1.5.1"
7374
},
7475
"peerDependencies": {

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

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,21 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
4949
rowIsland2 = fix.componentInstance.rowIsland2;
5050
}));
5151

52-
it('should allow only one cell to be selected in the whole hierarchical grid.', (async () => {
52+
it('should allow only one cell to be selected in the whole hierarchical grid.', fakeAsync(() => {
5353
hierarchicalGrid.height = '500px';
5454
hierarchicalGrid.reflow();
5555
fix.detectChanges();
5656

5757
let firstRow = hierarchicalGrid.getRowByIndex(0) as IgxHierarchicalRowComponent;
5858
firstRow.toggle();
5959
fix.detectChanges();
60+
tick(100);
6061
expect(firstRow.expanded).toBeTruthy();
6162

6263
let fCell = firstRow.cells.toArray()[0];
6364

6465
// select parent cell
6566
fCell.nativeElement.focus();
66-
await wait(100);
6767
fix.detectChanges();
6868

6969
expect(fCell.selected).toBeTruthy();
@@ -74,7 +74,6 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
7474

7575
// select child cell
7676
fChildCell.nativeElement.focus();
77-
await wait(100);
7877
fix.detectChanges();
7978

8079
expect(fChildCell.selected).toBeTruthy();
@@ -84,11 +83,11 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
8483
firstRow = hierarchicalGrid.getRowByIndex(0) as IgxHierarchicalRowComponent;
8584
fCell = firstRow.cells.toArray()[0];
8685
fCell.nativeElement.focus();
87-
await wait(100);
8886
fix.detectChanges();
8987
expect(fChildCell.selected).toBeFalsy();
9088
expect(fCell.selected).toBeTruthy();
9189
}));
90+
9291
});
9392

9493
describe('Row Selection', () => {
@@ -102,8 +101,8 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
102101

103102
it('should have checkboxes on each row', fakeAsync(() => {
104103
hierarchicalGrid.expandChildren = true;
105-
fix.detectChanges();
106104
tick(100);
105+
fix.detectChanges();
107106
rowIsland1.expandChildren = true;
108107
tick(100);
109108
fix.detectChanges();
@@ -144,7 +143,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
144143
const childGridLevel2 = childGridLevel1.hgridAPI.getChildGrids(false)[0];
145144

146145
hierarchicalGrid.selectAllRows();
147-
childGridLevel1.selectedRows(['00']);
146+
childGridLevel1.selectRows(['00']);
148147
fix.detectChanges();
149148

150149
// Change row selection for grids
@@ -493,7 +492,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
493492
expect(hierarchicalGrid.selectedRows()).toEqual(['1', '2', '3', '4']);
494493

495494
// Click on a row
496-
secondRow.nativeElement.dispatchEvent(new MouseEvent('click'));
495+
secondRow.onClick(UIInteractions.getMouseEvent('click'));
497496
fix.detectChanges();
498497

499498
GridSelectionFunctions.verifyRowSelected(secondRow);
@@ -503,7 +502,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
503502

504503
it('should retain selected row when filtering', () => {
505504
const firstRow = hierarchicalGrid.getRowByIndex(0);
506-
GridSelectionFunctions.clickRowCheckbox(firstRow);
505+
firstRow.onRowSelectorClick(UIInteractions.getMouseEvent('click'));
507506
fix.detectChanges();
508507

509508
hierarchicalGrid.filter('ID', '1', IgxStringFilteringOperand.instance().condition('doesNotContain'), true);
@@ -513,7 +512,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
513512
GridSelectionFunctions.verifyHeaderRowCheckboxState(fix, false, true);
514513
});
515514

516-
it('should child grid selection should not be changed when filter parent', () => {
515+
it('child grid selection should not be changed when filter parent', () => {
517516
rowIsland1.rowSelection = GridSelectionMode.multiple;
518517
fix.detectChanges();
519518

@@ -561,13 +560,14 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
561560
GridSelectionFunctions.verifyRowsArraySelected(childGrid.dataRowList.toArray());
562561
});
563562

564-
it('should not be able to select deleted row', () => {
563+
it('should not be able to select deleted row', fakeAsync(() => {
565564
// Expand first row
566565
const firstRow = hierarchicalGrid.getRowByIndex(0) as IgxHierarchicalRowComponent;
567566
firstRow.toggle();
568567
fix.detectChanges();
569568

570-
UIInteractions.simulateClickEvent(firstRow.nativeElement);
569+
firstRow.onClick(UIInteractions.getMouseEvent('click'));
570+
tick();
571571
fix.detectChanges();
572572

573573
GridSelectionFunctions.verifyRowSelected(firstRow);
@@ -582,15 +582,16 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
582582
expect(hierarchicalGrid.selectedRows()).toEqual([]);
583583

584584
// Click on deleted row
585-
UIInteractions.simulateClickEvent(firstRow.nativeElement);
585+
firstRow.onClick(UIInteractions.getMouseEvent('click'));
586+
tick();
586587
fix.detectChanges();
587588

588589
GridSelectionFunctions.verifyRowSelected(firstRow, false);
589590
GridSelectionFunctions.verifyHeaderRowCheckboxState(fix);
590591
expect(hierarchicalGrid.selectedRows()).toEqual([]);
591592

592593
// Click on checkbox for deleted row
593-
GridSelectionFunctions.clickRowCheckbox(firstRow);
594+
firstRow.onRowSelectorClick(UIInteractions.getMouseEvent('click'));
594595
fix.detectChanges();
595596

596597
GridSelectionFunctions.verifyRowSelected(firstRow, false);
@@ -610,14 +611,15 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
610611
expect(childGrid.selectedRows()).toEqual([]);
611612

612613
const childGridFirstRow = childGrid.getRowByIndex(0);
613-
UIInteractions.simulateClickEvent(childGridFirstRow.nativeElement, false, true);
614+
childGridFirstRow.onClick(UIInteractions.getMouseEvent('click', false, false, true));
615+
tick();
614616
fix.detectChanges();
615617

616618
GridSelectionFunctions.verifyRowSelected(firstRow, false);
617619
GridSelectionFunctions.verifyHeaderRowCheckboxState(fix, true);
618620
expect(hierarchicalGrid.selectedRows()).toEqual(['1', '2', '3', '4']);
619621
expect(childGrid.selectedRows()).toEqual(['00']);
620-
});
622+
}));
621623

622624
it('should be able to select added row', () => {
623625
// Set multiple selection to first row island
@@ -684,7 +686,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
684686
}));
685687

686688
it('should deselect deleted row', () => {
687-
GridSelectionFunctions.clickHeaderRowCheckbox(hierarchicalGrid);
689+
hierarchicalGrid.onHeaderSelectorClick(UIInteractions.getMouseEvent('click'));
688690
fix.detectChanges();
689691

690692
GridSelectionFunctions.verifyHeaderRowCheckboxState(hierarchicalGrid, true);

projects/igniteui-angular/src/lib/services/excel/excel-exporter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as JSZip from 'jszip/dist/jszip';
1+
import * as JSZip from 'jszip';
22

33
import { EventEmitter, Injectable, Output } from '@angular/core';
44
import { ExcelElementsFactory } from './excel-elements-factory';
@@ -38,7 +38,7 @@ export interface IExcelExportEndedEventArgs extends IBaseEventArgs {
3838
@Injectable()
3939
export class IgxExcelExporterService extends IgxBaseExporter {
4040

41-
private static ZIP_OPTIONS = { compression: 'DEFLATE', type: 'base64' };
41+
private static ZIP_OPTIONS = { compression: 'DEFLATE', type: 'base64' } as JSZip.JSZipGeneratorOptions<'base64'>;
4242
private _xlsx: JSZip;
4343

4444
/**

projects/igniteui-angular/src/lib/services/excel/excel-files.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { IExcelFile } from './excel-interfaces';
22
import { ExcelStrings } from './excel-strings';
33
import { WorksheetData } from './worksheet-data';
44

5-
import * as JSZip from 'jszip/dist/jszip';
5+
import * as JSZip from 'jszip';
66

77
/**
88
* @hidden

projects/igniteui-angular/src/lib/services/excel/excel-interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as JSZip from 'jszip/dist/jszip';
1+
import * as JSZip from 'jszip';
22

33
import {
44
ExcelFileTypes,

0 commit comments

Comments
 (0)