@@ -11,6 +11,7 @@ import {
11
11
screen ,
12
12
userEvent ,
13
13
waitFor ,
14
+ within ,
14
15
} from 'sentry-test/reactTestingLibrary' ;
15
16
16
17
import type { RawSpanType } from 'sentry/components/events/interfaces/spans/types' ;
@@ -820,27 +821,25 @@ describe('trace view', () => {
820
821
821
822
let rows = virtualizedContainer . querySelectorAll ( VISIBLE_TRACE_ROW_SELECTOR ) ;
822
823
await userEvent . click ( rows [ 0 ] ) ;
823
-
824
824
await waitFor ( ( ) => expect ( rows [ 0 ] ) . toHaveFocus ( ) ) ;
825
- await userEvent . keyboard ( '{arrowup}' ) ;
826
825
827
- expect (
828
- await findByText ( virtualizedContainer , / t r a n s a c t i o n - o p - 9 9 9 9 / i)
829
- ) . toBeInTheDocument ( ) ;
826
+ await userEvent . keyboard ( '{arrowup}' , { delay : null } ) ;
830
827
await waitFor ( ( ) => {
831
828
rows = virtualizedContainer . querySelectorAll ( VISIBLE_TRACE_ROW_SELECTOR ) ;
832
829
expect ( rows [ rows . length - 1 ] ) . toHaveFocus ( ) ;
833
830
} ) ;
834
-
835
- await userEvent . keyboard ( '{arrowdown}' ) ;
836
831
expect (
837
- await findByText ( virtualizedContainer , / t r a n s a c t i o n - o p - 0 / i)
832
+ await within ( virtualizedContainer ) . findByText ( / t r a n s a c t i o n - o p - 9 9 9 9 / i)
838
833
) . toBeInTheDocument ( ) ;
839
834
835
+ await userEvent . keyboard ( '{arrowdown}' , { delay : null } ) ;
840
836
await waitFor ( ( ) => {
841
837
rows = virtualizedContainer . querySelectorAll ( VISIBLE_TRACE_ROW_SELECTOR ) ;
842
838
expect ( rows [ 0 ] ) . toHaveFocus ( ) ;
843
839
} ) ;
840
+ expect (
841
+ await within ( virtualizedContainer ) . findByText ( / t r a n s a c t i o n - o p - 0 / i)
842
+ ) . toBeInTheDocument ( ) ;
844
843
} ) ;
845
844
it ( 'tab scrolls to next node' , async ( ) => {
846
845
const { virtualizedContainer} = await keyboardNavigationTestSetup ( ) ;
0 commit comments