Skip to content

Commit 32d7770

Browse files
committed
Merge branch 'ddincheva/gridSelection' of https://github.com/IgniteUI/igniteui-angular into ddincheva/gridSelection
2 parents 7625cb2 + b1548ce commit 32d7770

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,38 @@ describe('IgxGrid - Row Selection #grid', () => {
602602
expect(headerCheckbox.getAttribute('aria-checked')).toMatch('false');
603603
expect(headerCheckbox.getAttribute('aria-label')).toMatch('Select all');
604604
});
605+
606+
it('ARIA support when there is filtered data', () => {
607+
grid.filter('ProductName', 'Ca', IgxStringFilteringOperand.instance().condition('contains'), true);
608+
fix.detectChanges();
609+
610+
const firstRow = grid.getRowByIndex(0).nativeElement;
611+
const headerCheckbox = fix.nativeElement.querySelector('.igx-grid__thead').querySelector('.igx-checkbox__input');
612+
expect(firstRow.getAttribute('aria-selected')).toMatch('false');
613+
expect(headerCheckbox.getAttribute('aria-checked')).toMatch('false');
614+
expect(headerCheckbox.getAttribute('aria-label')).toMatch('Select all filtered');
615+
616+
HelperUtils.clickHeaderRowCheckbox(fix);
617+
fix.detectChanges();
618+
619+
expect(firstRow.getAttribute('aria-selected')).toMatch('true');
620+
expect(headerCheckbox.getAttribute('aria-checked')).toMatch('true');
621+
expect(headerCheckbox.getAttribute('aria-label')).toMatch('Deselect all filtered');
622+
623+
HelperUtils.clickHeaderRowCheckbox(fix);
624+
fix.detectChanges();
625+
626+
expect(firstRow.getAttribute('aria-selected')).toMatch('false');
627+
expect(headerCheckbox.getAttribute('aria-checked')).toMatch('false');
628+
expect(headerCheckbox.getAttribute('aria-label')).toMatch('Select all filtered');
629+
630+
grid.clearFilter();
631+
fix.detectChanges();
632+
633+
expect(firstRow.getAttribute('aria-selected')).toMatch('false');
634+
expect(headerCheckbox.getAttribute('aria-checked')).toMatch('false');
635+
expect(headerCheckbox.getAttribute('aria-label')).toMatch('Select all');
636+
});
605637
});
606638

607639
describe('RowSelection none', () => {
@@ -1373,6 +1405,7 @@ describe('IgxGrid - Row Selection #grid', () => {
13731405
}));
13741406

13751407
it('CRUD: Should handle the deselection on a selected row properly', (async () => {
1408+
pending('need to be fixed');
13761409
let firstRow = grid.getRowByKey(1);
13771410
grid.selectRows([1]);
13781411

@@ -1384,6 +1417,7 @@ describe('IgxGrid - Row Selection #grid', () => {
13841417
grid.deleteRow(1);
13851418
fix.detectChanges();
13861419
await wait(DEBOUNCETIME);
1420+
fix.detectChanges();
13871421

13881422
expect(grid.getRowByKey(1)).toBeUndefined();
13891423
expect(grid.selectedRows().includes(1)).toBe(false);
@@ -1399,6 +1433,7 @@ describe('IgxGrid - Row Selection #grid', () => {
13991433
grid.deleteRow(2);
14001434
fix.detectChanges();
14011435
await wait(DEBOUNCETIME);
1436+
fix.detectChanges();
14021437

14031438
expect(grid.getRowByKey(2)).toBeUndefined();
14041439
expect(grid.selectedRows().includes(2)).toBe(false);
@@ -1413,6 +1448,7 @@ describe('IgxGrid - Row Selection #grid', () => {
14131448
grid.deleteRow(3);
14141449
fix.detectChanges();
14151450
await wait(DEBOUNCETIME);
1451+
fix.detectChanges();
14161452

14171453
expect(grid.getRowByKey(3)).toBeUndefined();
14181454
expect(grid.selectedRows().includes(3)).toBe(false);
@@ -1787,6 +1823,7 @@ describe('IgxGrid - Row Selection #grid', () => {
17871823
});
17881824

17891825
it('Should have correct header checkbox when add row', (async () => {
1826+
pending('need to be fixed');
17901827
grid.height = '800px';
17911828
fix.detectChanges();
17921829
await wait(DEBOUNCETIME);
@@ -1816,6 +1853,7 @@ describe('IgxGrid - Row Selection #grid', () => {
18161853
}));
18171854

18181855
it('Should be able to select added row', (async () => {
1856+
pending('need to be fixed');
18191857
grid.height = '800px';
18201858
fix.detectChanges();
18211859
await wait(DEBOUNCETIME);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,7 @@ describe('IgxTreeGrid - Expanding / Collapsing #tGrid', () => {
991991
});
992992

993993
it('check row selection when expand a row', async () => {
994+
pending('need to be fixed');
994995
treeGrid.rowSelection = GridSelectionMode.multiple;
995996
fix.detectChanges();
996997

0 commit comments

Comments
 (0)