@@ -623,6 +623,8 @@ describe('AnalyticalTable', () => {
623
623
cy . findByTestId ( 'payloadRowsById' ) . should ( 'have.text' , '{"1":true,"2":true,"3":false}' ) ;
624
624
cy . findByTestId ( 'payloadAllRowsSelected' ) . should ( 'have.text' , 'false' ) ;
625
625
626
+ //select all
627
+ //click
626
628
cy . get ( '[data-row-index="0"][data-column-index="0"]' ) . click ( ) ;
627
629
cy . get ( '@onRowSelectSpy' ) . should ( 'have.callCount' , 6 ) ;
628
630
cy . findByTestId ( 'payload' ) . should (
@@ -635,6 +637,33 @@ describe('AnalyticalTable', () => {
635
637
) ;
636
638
cy . findByTestId ( 'payloadAllRowsSelected' ) . should ( 'have.text' , 'true' ) ;
637
639
640
+ // enter (keydown)
641
+ cy . get ( '[data-row-index="0"][data-column-index="0"]' ) . realPress ( 'Enter' ) ;
642
+ cy . get ( '@onRowSelectSpy' ) . should ( 'have.callCount' , 7 ) ;
643
+ cy . findByTestId ( 'payload' ) . should ( 'have.text' , '[]' ) ;
644
+ cy . findByTestId ( 'payloadRowsById' ) . should ( 'have.text' , '{}' ) ;
645
+ cy . findByTestId ( 'payloadAllRowsSelected' ) . should ( 'have.text' , 'false' ) ;
646
+
647
+ // Space (keyup) + ArrowDown => 1st row selected
648
+ cy . get ( '[data-row-index="0"][data-column-index="0"]' ) . realPress ( [ 'Space' , 'ArrowDown' ] ) ;
649
+ cy . get ( '@onRowSelectSpy' ) . should ( 'have.callCount' , 8 ) ;
650
+ cy . findByTestId ( 'payload' ) . should ( 'have.text' , '["0"]' ) ;
651
+ cy . findByTestId ( 'payloadRowsById' ) . should ( 'have.text' , '{"0":true}' ) ;
652
+ cy . findByTestId ( 'payloadAllRowsSelected' ) . should ( 'have.text' , 'false' ) ;
653
+
654
+ // Space (keyup) + ArrowUp => all rows selected
655
+ cy . get ( '[data-row-index="0"][data-column-index="0"]' ) . realPress ( [ 'Space' , 'ArrowUp' ] ) ;
656
+ cy . get ( '@onRowSelectSpy' ) . should ( 'have.callCount' , 9 ) ;
657
+ cy . findByTestId ( 'payload' ) . should (
658
+ 'have.text' ,
659
+ '["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"]'
660
+ ) ;
661
+ cy . findByTestId ( 'payloadRowsById' ) . should (
662
+ 'have.text' ,
663
+ '{"0":true,"1":true,"2":true,"3":true,"4":true,"5":true,"6":true,"7":true,"8":true,"9":true,"10":true,"11":true,"12":true,"13":true,"14":true,"15":true,"16":true,"17":true,"18":true,"19":true,"20":true}'
664
+ ) ;
665
+ cy . findByTestId ( 'payloadAllRowsSelected' ) . should ( 'have.text' , 'true' ) ;
666
+
638
667
cy . get ( '[data-row-index="0"][data-column-index="0"]' ) . click ( ) ;
639
668
640
669
cy . findByText ( 'Name-0' ) . click ( ) ;
@@ -647,7 +676,7 @@ describe('AnalyticalTable', () => {
647
676
cy . findByTestId ( 'payloadAllRowsSelected' ) . should ( 'have.text' , 'false' ) ;
648
677
649
678
cy . get ( '[data-row-index="0"][data-column-index="0"]' ) . click ( ) ;
650
- cy . get ( '@onRowSelectSpy' ) . should ( 'have.callCount' , 11 ) ;
679
+ cy . get ( '@onRowSelectSpy' ) . should ( 'have.callCount' , 14 ) ;
651
680
cy . findByTestId ( 'payload' ) . should ( 'have.text' , '["0","1","5","7","17","20"]' ) ;
652
681
cy . findByTestId ( 'payloadRowsById' ) . should ( 'have.text' , '{"0":true,"1":true,"5":true,"7":true,"17":true,"20":true}' ) ;
653
682
cy . findByTestId ( 'payloadAllRowsSelected' ) . should ( 'have.text' , 'false' ) ;
@@ -702,7 +731,7 @@ describe('AnalyticalTable', () => {
702
731
'{"0":true,"1":true,"2":true,"3":true,"4":true,"5":true,"6":true,"7":true,"8":true,"9":true,"10":true,"11":true,"12":true,"13":true,"14":true,"15":true,"16":true,"17":true,"18":true,"19":true,"20":true}'
703
732
) ;
704
733
cy . findByTestId ( 'payloadAllRowsSelected' ) . should ( 'have.text' , 'true' ) ;
705
- cy . get ( '@onRowSelectSpy' ) . should ( 'have.callCount' , 16 ) ;
734
+ cy . get ( '@onRowSelectSpy' ) . should ( 'have.callCount' , 19 ) ;
706
735
} ) ;
707
736
708
737
it ( 'row & header height' , ( ) => {
0 commit comments