@@ -11,6 +11,7 @@ import {
1111 screen ,
1212 userEvent ,
1313 waitFor ,
14+ within ,
1415} from 'sentry-test/reactTestingLibrary' ;
1516
1617import type { RawSpanType } from 'sentry/components/events/interfaces/spans/types' ;
@@ -820,27 +821,25 @@ describe('trace view', () => {
820821
821822 let rows = virtualizedContainer . querySelectorAll ( VISIBLE_TRACE_ROW_SELECTOR ) ;
822823 await userEvent . click ( rows [ 0 ] ) ;
823-
824824 await waitFor ( ( ) => expect ( rows [ 0 ] ) . toHaveFocus ( ) ) ;
825- await userEvent . keyboard ( '{arrowup}' ) ;
826825
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 } ) ;
830827 await waitFor ( ( ) => {
831828 rows = virtualizedContainer . querySelectorAll ( VISIBLE_TRACE_ROW_SELECTOR ) ;
832829 expect ( rows [ rows . length - 1 ] ) . toHaveFocus ( ) ;
833830 } ) ;
834-
835- await userEvent . keyboard ( '{arrowdown}' ) ;
836831 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)
838833 ) . toBeInTheDocument ( ) ;
839834
835+ await userEvent . keyboard ( '{arrowdown}' , { delay : null } ) ;
840836 await waitFor ( ( ) => {
841837 rows = virtualizedContainer . querySelectorAll ( VISIBLE_TRACE_ROW_SELECTOR ) ;
842838 expect ( rows [ 0 ] ) . toHaveFocus ( ) ;
843839 } ) ;
840+ expect (
841+ await within ( virtualizedContainer ) . findByText ( / t r a n s a c t i o n - o p - 0 / i)
842+ ) . toBeInTheDocument ( ) ;
844843 } ) ;
845844 it ( 'tab scrolls to next node' , async ( ) => {
846845 const { virtualizedContainer} = await keyboardNavigationTestSetup ( ) ;
0 commit comments