@@ -1149,7 +1149,7 @@ describe('Tree', () => {
11491149 expect ( cell ) . toHaveAttribute ( 'aria-colindex' , '1' ) ;
11501150 } ) ;
11511151
1152- it ( 'should focus the load more row when using ArrowDown/ArrowUp' , async ( ) => {
1152+ it ( 'should not focus the load more row when using ArrowDown/ArrowUp' , async ( ) => {
11531153 let { getAllByRole} = render ( < LoadingMoreTree isLoading /> ) ;
11541154
11551155 let rows = getAllByRole ( 'row' ) ;
@@ -1158,18 +1158,19 @@ describe('Tree', () => {
11581158
11591159 await user . tab ( ) ;
11601160 expect ( document . activeElement ) . toBe ( rows [ 0 ] ) ;
1161- for ( let i = 1 ; i < 8 ; i ++ ) {
1161+ for ( let i = 0 ; i < 5 ; i ++ ) {
11621162 await user . keyboard ( '{ArrowDown}' ) ;
1163- expect ( document . activeElement ) . toBe ( rows [ i ] ) ;
11641163 }
1164+ expect ( document . activeElement ) . toBe ( rows [ 5 ] ) ;
11651165
1166- for ( let i = 6 ; i >= 0 ; i -- ) {
1167- await user . keyboard ( '{ArrowUp}' ) ;
1168- expect ( document . activeElement ) . toBe ( rows [ i ] ) ;
1169- }
1166+ await user . keyboard ( '{ArrowDown}' ) ;
1167+ expect ( document . activeElement ) . toBe ( rows [ 7 ] ) ;
1168+
1169+ await user . keyboard ( '{ArrowUp}' ) ;
1170+ expect ( document . activeElement ) . toBe ( rows [ 5 ] ) ;
11701171 } ) ;
11711172
1172- it ( 'should focus the load more row when using End' , async ( ) => {
1173+ it ( 'should not focus the load more row when using End' , async ( ) => {
11731174 let { getAllByRole} = render ( < LoadingMoreTree isLoading /> ) ;
11741175
11751176 let rows = getAllByRole ( 'row' ) ;
@@ -1179,14 +1180,14 @@ describe('Tree', () => {
11791180 await user . tab ( ) ;
11801181 expect ( document . activeElement ) . toBe ( rows [ 0 ] ) ;
11811182 await user . keyboard ( '{End}' ) ;
1182- expect ( document . activeElement ) . toBe ( rows [ 21 ] ) ;
1183+ expect ( document . activeElement ) . toBe ( rows [ 20 ] ) ;
11831184
11841185 // Check that it didn't shift the focusedkey to the loader key even if DOM focus didn't shift to the loader
11851186 await user . keyboard ( '{ArrowUp}' ) ;
1186- expect ( document . activeElement ) . toBe ( rows [ 20 ] ) ;
1187+ expect ( document . activeElement ) . toBe ( rows [ 19 ] ) ;
11871188 } ) ;
11881189
1189- it ( 'should focus the load more row when using PageDown' , async ( ) => {
1190+ it ( 'should not focus the load more row when using PageDown' , async ( ) => {
11901191 let { getAllByRole} = render ( < LoadingMoreTree isLoading /> ) ;
11911192
11921193 let rows = getAllByRole ( 'row' ) ;
@@ -1196,11 +1197,11 @@ describe('Tree', () => {
11961197 await user . tab ( ) ;
11971198 expect ( document . activeElement ) . toBe ( rows [ 0 ] ) ;
11981199 await user . keyboard ( '{PageDown}' ) ;
1199- expect ( document . activeElement ) . toBe ( rows [ 21 ] ) ;
1200+ expect ( document . activeElement ) . toBe ( rows [ 20 ] ) ;
12001201
12011202 // Check that it didn't shift the focusedkey to the loader key even if DOM focus didn't shift to the loader
12021203 await user . keyboard ( '{ArrowUp}' ) ;
1203- expect ( document . activeElement ) . toBe ( rows [ 20 ] ) ;
1204+ expect ( document . activeElement ) . toBe ( rows [ 19 ] ) ;
12041205 } ) ;
12051206
12061207 it ( 'should not render no results state and the loader at the same time' , ( ) => {
0 commit comments