Skip to content

test(performance): Rearrange trace keyboard test #77519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions static/app/views/performance/newTraceDetails/trace.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
screen,
userEvent,
waitFor,
within,
} from 'sentry-test/reactTestingLibrary';

import type {RawSpanType} from 'sentry/components/events/interfaces/spans/types';
Expand Down Expand Up @@ -820,27 +821,25 @@ describe('trace view', () => {

let rows = virtualizedContainer.querySelectorAll(VISIBLE_TRACE_ROW_SELECTOR);
await userEvent.click(rows[0]);

await waitFor(() => expect(rows[0]).toHaveFocus());
await userEvent.keyboard('{arrowup}');

expect(
await findByText(virtualizedContainer, /transaction-op-9999/i)
).toBeInTheDocument();
await userEvent.keyboard('{arrowup}', {delay: null});
await waitFor(() => {
rows = virtualizedContainer.querySelectorAll(VISIBLE_TRACE_ROW_SELECTOR);
expect(rows[rows.length - 1]).toHaveFocus();
});

await userEvent.keyboard('{arrowdown}');
expect(
await findByText(virtualizedContainer, /transaction-op-0/i)
await within(virtualizedContainer).findByText(/transaction-op-9999/i)
).toBeInTheDocument();

await userEvent.keyboard('{arrowdown}', {delay: null});
await waitFor(() => {
rows = virtualizedContainer.querySelectorAll(VISIBLE_TRACE_ROW_SELECTOR);
expect(rows[0]).toHaveFocus();
});
expect(
await within(virtualizedContainer).findByText(/transaction-op-0/i)
).toBeInTheDocument();
});
it('tab scrolls to next node', async () => {
const {virtualizedContainer} = await keyboardNavigationTestSetup();
Expand Down
Loading