@@ -153,7 +153,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
153
153
fix . detectChanges ( ) ;
154
154
155
155
expect ( hierarchicalGrid . rowSelection ) . toBe ( GridSelectionMode . none ) ;
156
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ ] ) ;
156
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ ] ) ;
157
157
GridSelectionFunctions . verifyHeaderRowHasCheckbox ( hierarchicalGrid , false , false ) ;
158
158
for ( const r of hierarchicalGrid . dataRowList . toArray ( ) ) {
159
159
GridSelectionFunctions . verifyRowHasCheckbox ( r . nativeElement , false , false ) ;
@@ -305,15 +305,15 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
305
305
fix . detectChanges ( ) ;
306
306
307
307
GridSelectionFunctions . verifyRowSelected ( firstRow ) ;
308
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '0' ] ) ;
308
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '0' ] ) ;
309
309
310
310
const fourthRow = hierarchicalGrid . getRowByIndex ( 4 ) ;
311
311
UIInteractions . simulateClickEvent ( fourthRow . nativeElement , true ) ;
312
312
fix . detectChanges ( ) ;
313
313
314
314
GridSelectionFunctions . verifyRowsArraySelected (
315
315
[ firstRow , hierarchicalGrid . getRowByIndex ( 2 ) , hierarchicalGrid . getRowByIndex ( 3 ) , fourthRow ] ) ;
316
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '0' , '1' , '2' , '3' ] ) ;
316
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '0' , '1' , '2' , '3' ] ) ;
317
317
318
318
// Verify no rows are selected in the child grid
319
319
const childGrid = hierarchicalGrid . hgridAPI . getChildGrids ( false ) [ 0 ] ;
@@ -335,14 +335,14 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
335
335
fix . detectChanges ( ) ;
336
336
337
337
GridSelectionFunctions . verifyRowSelected ( firstRow ) ;
338
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '0' ] ) ;
338
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '0' ] ) ;
339
339
340
340
const fourthRow = hierarchicalGrid . getRowByIndex ( 4 ) ;
341
341
UIInteractions . simulateClickEvent ( fourthRow . nativeElement , false , true ) ;
342
342
fix . detectChanges ( ) ;
343
343
344
344
GridSelectionFunctions . verifyRowsArraySelected ( [ firstRow , fourthRow ] ) ;
345
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '0' , '3' ] ) ;
345
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '0' , '3' ] ) ;
346
346
347
347
// Click on a row in the child grid
348
348
const childGrid = hierarchicalGrid . hgridAPI . getChildGrids ( false ) [ 0 ] ;
@@ -353,7 +353,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
353
353
fix . detectChanges ( ) ;
354
354
355
355
GridSelectionFunctions . verifyRowsArraySelected ( [ firstRow , fourthRow ] ) ;
356
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '0' , '3' ] ) ;
356
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '0' , '3' ] ) ;
357
357
GridSelectionFunctions . verifyRowSelected ( childGridFirstRow ) ;
358
358
expect ( childGrid . selectedRows ( ) ) . toEqual ( [ '02' ] ) ;
359
359
} ) ;
@@ -421,7 +421,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
421
421
GridSelectionFunctions . clickHeaderRowCheckbox ( hierarchicalGrid ) ;
422
422
fix . detectChanges ( ) ;
423
423
424
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '0' , '1' , '2' , '3' , '4' ] ) ;
424
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '0' , '1' , '2' , '3' , '4' ] ) ;
425
425
GridSelectionFunctions . verifyHeaderRowCheckboxState ( hierarchicalGrid , true ) ;
426
426
427
427
const childGrid1 = hierarchicalGrid . hgridAPI . getChildGrids ( false ) [ 0 ] ;
@@ -435,7 +435,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
435
435
GridSelectionFunctions . clickHeaderRowCheckbox ( childGrid1 ) ;
436
436
fix . detectChanges ( ) ;
437
437
438
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '0' , '1' , '2' , '3' , '4' ] ) ;
438
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '0' , '1' , '2' , '3' , '4' ] ) ;
439
439
GridSelectionFunctions . verifyHeaderRowCheckboxState ( hierarchicalGrid , true ) ;
440
440
441
441
expect ( childGrid1 . selectedRows ( ) ) . toEqual ( [ '00' , '01' , '02' ] ) ;
@@ -447,7 +447,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
447
447
GridSelectionFunctions . clickHeaderRowCheckbox ( hierarchicalGrid ) ;
448
448
fix . detectChanges ( ) ;
449
449
450
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ ] ) ;
450
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ ] ) ;
451
451
GridSelectionFunctions . verifyHeaderRowCheckboxState ( hierarchicalGrid ) ;
452
452
453
453
expect ( childGrid1 . selectedRows ( ) ) . toEqual ( [ '00' , '01' , '02' ] ) ;
@@ -459,7 +459,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
459
459
GridSelectionFunctions . clickHeaderRowCheckbox ( childGrid1 ) ;
460
460
fix . detectChanges ( ) ;
461
461
462
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ ] ) ;
462
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ ] ) ;
463
463
GridSelectionFunctions . verifyHeaderRowCheckboxState ( hierarchicalGrid ) ;
464
464
465
465
expect ( childGrid1 . selectedRows ( ) ) . toEqual ( [ ] ) ;
@@ -481,23 +481,23 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
481
481
} ) ;
482
482
483
483
GridSelectionFunctions . verifyHeaderRowCheckboxState ( fix , true ) ;
484
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '0' , '1' , '2' , '3' , '4' ] ) ;
484
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '0' , '1' , '2' , '3' , '4' ] ) ;
485
485
486
486
// Unselect a row
487
487
GridSelectionFunctions . clickRowCheckbox ( firstRow ) ;
488
488
fix . detectChanges ( ) ;
489
489
490
490
GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
491
491
GridSelectionFunctions . verifyHeaderRowCheckboxState ( fix , false , true ) ;
492
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '1' , '2' , '3' , '4' ] ) ;
492
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '1' , '2' , '3' , '4' ] ) ;
493
493
494
494
// Click on a row
495
495
secondRow . onClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
496
496
fix . detectChanges ( ) ;
497
497
498
498
GridSelectionFunctions . verifyRowSelected ( secondRow ) ;
499
499
GridSelectionFunctions . verifyHeaderRowCheckboxState ( fix , false , true ) ;
500
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '1' ] ) ;
500
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '1' ] ) ;
501
501
} ) ;
502
502
503
503
it ( 'should retain selected row when filtering' , ( ) => {
@@ -579,7 +579,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
579
579
580
580
GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
581
581
GridSelectionFunctions . verifyHeaderRowCheckboxState ( fix ) ;
582
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ ] ) ;
582
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ ] ) ;
583
583
584
584
// Click on deleted row
585
585
firstRow . onClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
@@ -588,23 +588,23 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
588
588
589
589
GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
590
590
GridSelectionFunctions . verifyHeaderRowCheckboxState ( fix ) ;
591
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ ] ) ;
591
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ ] ) ;
592
592
593
593
// Click on checkbox for deleted row
594
594
firstRow . onRowSelectorClick ( UIInteractions . getMouseEvent ( 'click' ) ) ;
595
595
fix . detectChanges ( ) ;
596
596
597
597
GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
598
598
GridSelectionFunctions . verifyHeaderRowCheckboxState ( fix ) ;
599
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ ] ) ;
599
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ ] ) ;
600
600
601
601
// Select all rows
602
602
hierarchicalGrid . selectAllRows ( ) ;
603
603
fix . detectChanges ( ) ;
604
604
605
605
GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
606
606
GridSelectionFunctions . verifyHeaderRowCheckboxState ( fix , true ) ;
607
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '1' , '2' , '3' , '4' ] ) ;
607
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '1' , '2' , '3' , '4' ] ) ;
608
608
609
609
// Click on a row in the child grid
610
610
const childGrid = hierarchicalGrid . hgridAPI . getChildGrids ( false ) [ 0 ] ;
@@ -617,7 +617,7 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
617
617
618
618
GridSelectionFunctions . verifyRowSelected ( firstRow , false ) ;
619
619
GridSelectionFunctions . verifyHeaderRowCheckboxState ( fix , true ) ;
620
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '1' , '2' , '3' , '4' ] ) ;
620
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '1' , '2' , '3' , '4' ] ) ;
621
621
expect ( childGrid . selectedRows ( ) ) . toEqual ( [ '00' ] ) ;
622
622
} ) ) ;
623
623
@@ -635,21 +635,21 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
635
635
fix . detectChanges ( ) ;
636
636
637
637
GridSelectionFunctions . verifyHeaderRowCheckboxState ( hierarchicalGrid , true ) ;
638
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '0' , '1' , '2' , '3' , '4' ] ) ;
638
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '0' , '1' , '2' , '3' , '4' ] ) ;
639
639
640
640
hierarchicalGrid . addRow ( { ID : '5' , ChildLevels : 3 , ProductName : 'New Product' } ) ;
641
641
fix . detectChanges ( ) ;
642
642
643
643
GridSelectionFunctions . verifyHeaderRowCheckboxState ( hierarchicalGrid , false , true ) ;
644
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '0' , '1' , '2' , '3' , '4' ] ) ;
644
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '0' , '1' , '2' , '3' , '4' ] ) ;
645
645
let lastRow = hierarchicalGrid . getRowByIndex ( 6 ) ;
646
646
GridSelectionFunctions . verifyRowSelected ( lastRow , false ) ;
647
647
648
648
GridSelectionFunctions . clickRowCheckbox ( lastRow ) ;
649
649
fix . detectChanges ( ) ;
650
650
651
651
GridSelectionFunctions . verifyHeaderRowCheckboxState ( hierarchicalGrid , true ) ;
652
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '0' , '1' , '2' , '3' , '4' , '5' ] ) ;
652
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '0' , '1' , '2' , '3' , '4' , '5' ] ) ;
653
653
654
654
// Add row in child grid
655
655
const childGrid = hierarchicalGrid . hgridAPI . getChildGrids ( false ) [ 0 ] ;
@@ -690,28 +690,28 @@ describe('IgxHierarchicalGrid selection #hGrid', () => {
690
690
fix . detectChanges ( ) ;
691
691
692
692
GridSelectionFunctions . verifyHeaderRowCheckboxState ( hierarchicalGrid , true ) ;
693
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '0' , '1' , '2' , '3' , '4' ] ) ;
693
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '0' , '1' , '2' , '3' , '4' ] ) ;
694
694
695
695
hierarchicalGrid . deleteRow ( '1' ) ;
696
696
fix . detectChanges ( ) ;
697
697
698
698
GridSelectionFunctions . verifyHeaderRowCheckboxState ( hierarchicalGrid , true ) ;
699
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '0' , '2' , '3' , '4' ] ) ;
699
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '0' , '2' , '3' , '4' ] ) ;
700
700
expect ( hierarchicalGrid . dataRowList . length ) . toEqual ( 4 ) ;
701
701
702
702
const firstRow = hierarchicalGrid . getRowByIndex ( 0 ) ;
703
703
GridSelectionFunctions . clickRowCheckbox ( firstRow ) ;
704
704
fix . detectChanges ( ) ;
705
705
706
706
GridSelectionFunctions . verifyHeaderRowCheckboxState ( hierarchicalGrid , false , true ) ;
707
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '2' , '3' , '4' ] ) ;
707
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '2' , '3' , '4' ] ) ;
708
708
709
709
hierarchicalGrid . deleteRow ( '0' ) ;
710
710
fix . detectChanges ( ) ;
711
711
712
712
expect ( hierarchicalGrid . dataRowList . length ) . toEqual ( 3 ) ;
713
713
GridSelectionFunctions . verifyHeaderRowCheckboxState ( hierarchicalGrid , true ) ;
714
- expect ( hierarchicalGrid . selectedRows ( ) ) . toEqual ( [ '2' , '3' , '4' ] ) ;
714
+ expect ( hierarchicalGrid . selectedRows ) . toEqual ( [ '2' , '3' , '4' ] ) ;
715
715
} ) ;
716
716
717
717
it ( 'should be able to select added row' , ( ) => {
0 commit comments