Skip to content

Commit b74546e

Browse files
authored
test(performance): Rearrange trace keyboard test (#77519)
1 parent 2de49ac commit b74546e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

static/app/views/performance/newTraceDetails/trace.spec.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
screen,
1212
userEvent,
1313
waitFor,
14+
within,
1415
} from 'sentry-test/reactTestingLibrary';
1516

1617
import 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, /transaction-op-9999/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, /transaction-op-0/i)
832+
await within(virtualizedContainer).findByText(/transaction-op-9999/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(/transaction-op-0/i)
842+
).toBeInTheDocument();
844843
});
845844
it('tab scrolls to next node', async () => {
846845
const {virtualizedContainer} = await keyboardNavigationTestSetup();

0 commit comments

Comments
 (0)