Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
23ba1b7
test(igxPivot): Add more test to increase test coverage
mddragnev Mar 7, 2022
47cffaa
Merge branch 'master' into mdragnev/pivot-test-coverage
kdinev Mar 8, 2022
d603777
Merge branch '13.1.x' into mdragnev/pivot-test-coverage
kdinev Mar 8, 2022
61a0340
Merge branch '13.1.x' into mdragnev/pivot-test-coverage
kdinev Mar 8, 2022
0f93892
Merge branch '13.1.x' into mdragnev/pivot-test-coverage
kdinev Mar 8, 2022
0dd0c40
Merge branch '13.1.x' into mdragnev/pivot-test-coverage
mddragnev Mar 9, 2022
a65a183
chore(*): refactor dimension-header-group template, use getters, remo…
mddragnev Mar 9, 2022
ef6d09e
test(pivot): Add test for collapsing pivot row
mddragnev Mar 9, 2022
ca6bfda
chore(pivot): refactor filterRemoved, onSummaryClick, remove unused m…
mddragnev Mar 10, 2022
010b751
test(pivot): Add more tests for better coverage
mddragnev Mar 10, 2022
f911c3a
chore(pivot): fix failing test
mddragnev Mar 11, 2022
98b46f5
Merge branch '13.1.x' of https://github.com/IgniteUI/igniteui-angular…
mddragnev Mar 11, 2022
ef5b0d7
chore(*): Remove unused methods
mddragnev Mar 11, 2022
e66c749
test(pivot): update some tests and add more
mddragnev Mar 11, 2022
6f8f6b7
Merge branch '13.1.x' into mdragnev/pivot-test-coverage
ChronosSF Mar 14, 2022
13b18bb
chore(*): remove some more unused code
mddragnev Mar 14, 2022
efb6852
test(pivot): update some tests and add some more
mddragnev Mar 14, 2022
1c1c8f0
Merge branch 'mdragnev/pivot-test-coverage' of https://github.com/Ign…
mddragnev Mar 14, 2022
9a3585f
chore(*): fix failing tests
mddragnev Mar 15, 2022
aeb9aaf
chore(*): update failing test
mddragnev Mar 15, 2022
ff85ee7
Merge branch '13.1.x' into mdragnev/pivot-test-coverage
mddragnev Mar 15, 2022
7e4bfcf
Merge branch '13.1.x' into mdragnev/pivot-test-coverage
dkamburov Mar 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ export class PivotColumnDimensionsStrategy implements IPivotDimensionStrategy {
})
}
});

}
this.applyAggregates(rec, columns, values, pivotKeys);
}
Expand All @@ -123,10 +122,6 @@ export class PivotColumnDimensionsStrategy implements IPivotDimensionStrategy {
}
return leafs;
}

private isLeaf(record, pivotKeys) {
return !(record[pivotKeys.records] && record[pivotKeys.records].some(r => r[pivotKeys.records]));
}
}

export class DimensionValuesFilteringStrategy extends FilteringStrategy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ describe('IgxPivotGrid - Keyboard navigation #pivotGrid', () => {
GridFunctions.verifyHeaderIsFocused(secondCell.parent);
activeCells = fixture.debugElement.queryAll(By.css(`${ACTIVE_CELL_CSS_CLASS}`));
expect(activeCells.length).toBe(1);

// should do nothing if wrong key is pressed
UIInteractions.simulateClickAndSelectEvent(firstCell);
fixture.detectChanges();
GridFunctions.verifyHeaderIsFocused(firstCell.parent);
activeCells = fixture.debugElement.queryAll(By.css(`${ACTIVE_CELL_CSS_CLASS}`));
expect(activeCells.length).toBe(1);
UIInteractions.triggerKeyDownEvtUponElem('h', firstCell.nativeElement);
fixture.detectChanges();
GridFunctions.verifyHeaderIsFocused(firstCell.parent);
});

it('should not go outside of the boundaries of the row dimensions content', () => {
Expand Down Expand Up @@ -119,6 +129,39 @@ describe('IgxPivotGrid - Keyboard navigation #pivotGrid', () => {
expect(activeCells.length).toBe(1);
});

it('should allow navigating from any to first row headers(Ctrl + ArrowUp)', () => {
// Ctrl + arrowup
let allGroups = fixture.debugElement.queryAll(
By.directive(IgxPivotRowDimensionHeaderComponent));
const thirdCell = allGroups.filter(x => x.componentInstance.column.field === 'ProductCategory')[2]
UIInteractions.simulateClickAndSelectEvent(thirdCell);
fixture.detectChanges();

UIInteractions.triggerKeyDownEvtUponElem('ArrowUp', thirdCell.nativeElement, true, false, false, true);
fixture.detectChanges();

allGroups = fixture.debugElement.queryAll(
By.directive(IgxPivotRowDimensionHeaderComponent));
const firstCell = allGroups[0];
GridFunctions.verifyHeaderIsFocused(firstCell.parent);
let activeCells = fixture.debugElement.queryAll(By.css(`${ACTIVE_CELL_CSS_CLASS}`));
expect(activeCells.length).toBe(1);

// just arrow up
UIInteractions.simulateClickAndSelectEvent(thirdCell);
fixture.detectChanges();

UIInteractions.triggerKeyDownEvtUponElem('ArrowUp', thirdCell.nativeElement, true, false, false, false);
fixture.detectChanges();
allGroups = fixture.debugElement.queryAll(
By.directive(IgxPivotRowDimensionHeaderComponent));
const secondCell = allGroups.filter(x => x.componentInstance.column.field === 'ProductCategory')[1];
GridFunctions.verifyHeaderIsFocused(secondCell.parent);
activeCells = fixture.debugElement.queryAll(By.css(`${ACTIVE_CELL_CSS_CLASS}`));
expect(activeCells.length).toBe(1);

});

it('should allow navigating between column headers', () => {
let firstHeader = fixture.debugElement.queryAll(
By.css(`${PIVOT_HEADER_ROW} ${HEADER_CELL_CSS_CLASS}`))[0];
Expand All @@ -133,7 +176,7 @@ describe('IgxPivotGrid - Keyboard navigation #pivotGrid', () => {

UIInteractions.triggerKeyDownEvtUponElem('ArrowRight', pivotGrid.theadRow.nativeElement);
fixture.detectChanges();

const secondHeader = fixture.debugElement.queryAll(
By.css(`${PIVOT_HEADER_ROW} ${HEADER_CELL_CSS_CLASS}`))[1];
GridFunctions.verifyHeaderIsFocused(secondHeader.parent);
Expand Down Expand Up @@ -191,4 +234,33 @@ describe('IgxPivotGrid - Keyboard navigation #pivotGrid', () => {
activeCells = fixture.debugElement.queryAll(By.css(`${ACTIVE_CELL_CSS_CLASS}`));
expect(activeCells.length).toBe(1);
});

it('should allow navigating within the cells of the body', async () => {
const cell = pivotGrid.rowList.first.cells.first;
GridFunctions.focusFirstCell(fixture, pivotGrid);
fixture.detectChanges();
expect(pivotGrid.navigation.activeNode.row).toBeUndefined();
expect(pivotGrid.navigation.activeNode.column).toBeUndefined();

UIInteractions.simulateClickAndSelectEvent(cell.nativeElement);
fixture.detectChanges();

GridFunctions.focusFirstCell(fixture, pivotGrid);
fixture.detectChanges();
expect(pivotGrid.navigation.activeNode.row).toBeDefined();
expect(pivotGrid.navigation.activeNode.column).toBeDefined();

let activeCells = fixture.debugElement.queryAll(By.css(`.igx-grid__td--active`));
expect(activeCells.length).toBe(1);
expect(cell.column.field).toEqual('Stanley-UnitsSold');

const gridContent = GridFunctions.getGridContent(fixture);
UIInteractions.triggerEventHandlerKeyDown('arrowright', gridContent);
await wait(30);
fixture.detectChanges();

activeCells = fixture.debugElement.queryAll(By.css(`.igx-grid__td--active`));
expect(activeCells.length).toBe(1);
expect(activeCells[0].componentInstance.column.field).toEqual('Stanley-UnitPrice')
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
}

public get selectedRows(): any[] {
if (!this.selectionService.getSelectedRows()) {
if (this.selectionService.getSelectedRows().length === 0) {
return [];
}
const selectedRowIds = [];
Expand Down Expand Up @@ -2029,13 +2029,6 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
return cols;
}

/**
* @hidden @internal
*/
public getPropName(dim: IPivotDimension) {
return !!dim ?? dim.memberName + this.pivotKeys.rowDimensionSeparator + 'height';
}

/**
* @hidden @internal
*/
Expand Down
Loading