@@ -617,6 +617,8 @@ describe('AnalyticalTable', () => {
617617 cy . findByTestId ( 'payloadRowsById' ) . should ( 'have.text' , '{"1":true,"2":true,"3":false}' ) ;
618618 cy . findByTestId ( 'payloadAllRowsSelected' ) . should ( 'have.text' , 'false' ) ;
619619
620+ //select all
621+ //click
620622 cy . get ( '[data-row-index="0"][data-column-index="0"]' ) . click ( ) ;
621623 cy . get ( '@onRowSelectSpy' ) . should ( 'have.callCount' , 6 ) ;
622624 cy . findByTestId ( 'payload' ) . should (
@@ -629,6 +631,33 @@ describe('AnalyticalTable', () => {
629631 ) ;
630632 cy . findByTestId ( 'payloadAllRowsSelected' ) . should ( 'have.text' , 'true' ) ;
631633
634+ // enter (keydown)
635+ cy . get ( '[data-row-index="0"][data-column-index="0"]' ) . realPress ( 'Enter' ) ;
636+ cy . get ( '@onRowSelectSpy' ) . should ( 'have.callCount' , 7 ) ;
637+ cy . findByTestId ( 'payload' ) . should ( 'have.text' , '[]' ) ;
638+ cy . findByTestId ( 'payloadRowsById' ) . should ( 'have.text' , '{}' ) ;
639+ cy . findByTestId ( 'payloadAllRowsSelected' ) . should ( 'have.text' , 'false' ) ;
640+
641+ // Space (keyup) + ArrowDown => 1st row selected
642+ cy . get ( '[data-row-index="0"][data-column-index="0"]' ) . realPress ( [ 'Space' , 'ArrowDown' ] ) ;
643+ cy . get ( '@onRowSelectSpy' ) . should ( 'have.callCount' , 8 ) ;
644+ cy . findByTestId ( 'payload' ) . should ( 'have.text' , '["0"]' ) ;
645+ cy . findByTestId ( 'payloadRowsById' ) . should ( 'have.text' , '{"0":true}' ) ;
646+ cy . findByTestId ( 'payloadAllRowsSelected' ) . should ( 'have.text' , 'false' ) ;
647+
648+ // Space (keyup) + ArrowUp => all rows selected
649+ cy . get ( '[data-row-index="0"][data-column-index="0"]' ) . realPress ( [ 'Space' , 'ArrowUp' ] ) ;
650+ cy . get ( '@onRowSelectSpy' ) . should ( 'have.callCount' , 9 ) ;
651+ cy . findByTestId ( 'payload' ) . should (
652+ 'have.text' ,
653+ '["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"]'
654+ ) ;
655+ cy . findByTestId ( 'payloadRowsById' ) . should (
656+ 'have.text' ,
657+ '{"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}'
658+ ) ;
659+ cy . findByTestId ( 'payloadAllRowsSelected' ) . should ( 'have.text' , 'true' ) ;
660+
632661 cy . get ( '[data-row-index="0"][data-column-index="0"]' ) . click ( ) ;
633662
634663 cy . findByText ( 'Name-0' ) . click ( ) ;
@@ -641,7 +670,7 @@ describe('AnalyticalTable', () => {
641670 cy . findByTestId ( 'payloadAllRowsSelected' ) . should ( 'have.text' , 'false' ) ;
642671
643672 cy . get ( '[data-row-index="0"][data-column-index="0"]' ) . click ( ) ;
644- cy . get ( '@onRowSelectSpy' ) . should ( 'have.callCount' , 11 ) ;
673+ cy . get ( '@onRowSelectSpy' ) . should ( 'have.callCount' , 14 ) ;
645674 cy . findByTestId ( 'payload' ) . should ( 'have.text' , '["0","1","5","7","17","20"]' ) ;
646675 cy . findByTestId ( 'payloadRowsById' ) . should ( 'have.text' , '{"0":true,"1":true,"5":true,"7":true,"17":true,"20":true}' ) ;
647676 cy . findByTestId ( 'payloadAllRowsSelected' ) . should ( 'have.text' , 'false' ) ;
@@ -696,7 +725,7 @@ describe('AnalyticalTable', () => {
696725 '{"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}'
697726 ) ;
698727 cy . findByTestId ( 'payloadAllRowsSelected' ) . should ( 'have.text' , 'true' ) ;
699- cy . get ( '@onRowSelectSpy' ) . should ( 'have.callCount' , 16 ) ;
728+ cy . get ( '@onRowSelectSpy' ) . should ( 'have.callCount' , 19 ) ;
700729 } ) ;
701730
702731 it ( 'row & header height' , ( ) => {
0 commit comments