@@ -446,16 +446,16 @@ describe('getFlatDataFromTree', () => {
446
446
getNodeKey : keyFromTreeIndex ,
447
447
treeData : [ { key : 0 } ] ,
448
448
} ) ) . toEqual ( [
449
- { node : { key : 0 } , path : [ 0 ] , lowerSiblingCounts : [ 0 ] , treeIndex : 0 } ,
449
+ { node : { key : 0 } , parentNode : null , path : [ 0 ] , lowerSiblingCounts : [ 0 ] , treeIndex : 0 } ,
450
450
] ) ;
451
451
452
452
expect ( getFlatDataFromTree ( {
453
453
ignoreCollapsed : true ,
454
454
treeData : [ { key : 0 } , { key : 1 } ] ,
455
455
getNodeKey : keyFromTreeIndex
456
456
} ) ) . toEqual ( [
457
- { node : { key : 0 } , path : [ 0 ] , lowerSiblingCounts : [ 1 ] , treeIndex : 0 } ,
458
- { node : { key : 1 } , path : [ 1 ] , lowerSiblingCounts : [ 0 ] , treeIndex : 1 }
457
+ { node : { key : 0 } , parentNode : null , path : [ 0 ] , lowerSiblingCounts : [ 1 ] , treeIndex : 0 } ,
458
+ { node : { key : 1 } , parentNode : null , path : [ 1 ] , lowerSiblingCounts : [ 0 ] , treeIndex : 1 }
459
459
] ) ;
460
460
} ) ;
461
461
@@ -487,8 +487,8 @@ describe('getFlatDataFromTree', () => {
487
487
getNodeKey : keyFromTreeIndex ,
488
488
treeData,
489
489
} ) ) . toEqual ( [
490
- { node : treeData [ 0 ] , path : [ 0 ] , lowerSiblingCounts : [ 1 ] , treeIndex : 0 } ,
491
- { node : treeData [ 1 ] , path : [ 1 ] , lowerSiblingCounts : [ 0 ] , treeIndex : 1 }
490
+ { node : treeData [ 0 ] , parentNode : null , path : [ 0 ] , lowerSiblingCounts : [ 1 ] , treeIndex : 0 } ,
491
+ { node : treeData [ 1 ] , parentNode : null , path : [ 1 ] , lowerSiblingCounts : [ 0 ] , treeIndex : 1 }
492
492
] ) ;
493
493
} ) ;
494
494
@@ -524,30 +524,35 @@ describe('getFlatDataFromTree', () => {
524
524
} ) ) . toEqual ( [
525
525
{
526
526
node : treeData [ 0 ] ,
527
+ parentNode : null ,
527
528
path : [ 0 ] ,
528
529
lowerSiblingCounts : [ 1 ] ,
529
530
treeIndex : 0 ,
530
531
} ,
531
532
{
532
533
node : treeData [ 0 ] . children [ 0 ] ,
534
+ parentNode : treeData [ 0 ] ,
533
535
path : [ 0 , 1 ] ,
534
536
lowerSiblingCounts : [ 1 , 1 ] ,
535
537
treeIndex : 1 ,
536
538
} ,
537
539
{
538
540
node : treeData [ 0 ] . children [ 1 ] ,
541
+ parentNode : treeData [ 0 ] ,
539
542
path : [ 0 , 4 ] ,
540
543
lowerSiblingCounts : [ 1 , 0 ] ,
541
544
treeIndex : 2 ,
542
545
} ,
543
546
{
544
547
node : treeData [ 0 ] . children [ 1 ] . children [ 0 ] ,
548
+ parentNode : treeData [ 0 ] . children [ 1 ] ,
545
549
path : [ 0 , 4 , 5 ] ,
546
550
lowerSiblingCounts : [ 1 , 0 , 0 ] ,
547
551
treeIndex : 3 ,
548
552
} ,
549
553
{
550
554
node : treeData [ 1 ] ,
555
+ parentNode : null ,
551
556
path : [ 6 ] ,
552
557
lowerSiblingCounts : [ 0 ] ,
553
558
treeIndex : 4 ,
@@ -588,42 +593,49 @@ describe('getFlatDataFromTree', () => {
588
593
} ) ) . toEqual ( [
589
594
{
590
595
node : treeData [ 0 ] ,
596
+ parentNode : null ,
591
597
path : [ 0 ] ,
592
598
lowerSiblingCounts : [ 1 ] ,
593
599
treeIndex : 0 ,
594
600
} ,
595
601
{
596
602
node : treeData [ 0 ] . children [ 0 ] ,
603
+ parentNode : treeData [ 0 ] ,
597
604
path : [ 0 , 1 ] ,
598
605
lowerSiblingCounts : [ 1 , 1 ] ,
599
606
treeIndex : 1 ,
600
607
} ,
601
608
{
602
609
node : treeData [ 0 ] . children [ 0 ] . children [ 0 ] ,
610
+ parentNode : treeData [ 0 ] . children [ 0 ] ,
603
611
path : [ 0 , 1 , 2 ] ,
604
612
lowerSiblingCounts : [ 1 , 1 , 1 ] ,
605
613
treeIndex : 2 ,
606
614
} ,
607
615
{
608
616
node : treeData [ 0 ] . children [ 0 ] . children [ 1 ] ,
617
+ parentNode : treeData [ 0 ] . children [ 0 ] ,
609
618
path : [ 0 , 1 , 3 ] ,
610
619
lowerSiblingCounts : [ 1 , 1 , 0 ] ,
611
620
treeIndex : 3 ,
612
621
} ,
613
622
{
614
623
node : treeData [ 0 ] . children [ 1 ] ,
624
+ parentNode : treeData [ 0 ] ,
615
625
path : [ 0 , 4 ] ,
616
626
lowerSiblingCounts : [ 1 , 0 ] ,
617
627
treeIndex : 4 ,
618
628
} ,
619
629
{
620
630
node : treeData [ 0 ] . children [ 1 ] . children [ 0 ] ,
631
+ parentNode : treeData [ 0 ] . children [ 1 ] ,
621
632
path : [ 0 , 4 , 5 ] ,
622
633
lowerSiblingCounts : [ 1 , 0 , 0 ] ,
623
634
treeIndex : 5 ,
624
635
} ,
625
636
{
626
637
node : treeData [ 1 ] ,
638
+ parentNode : null ,
627
639
path : [ 6 ] ,
628
640
lowerSiblingCounts : [ 0 ] ,
629
641
treeIndex : 6 ,
0 commit comments