Skip to content

Commit c33cd46

Browse files
test(trace): Wait for list load without ambiguous findByText
during search, expanding a row retriggers search used within(container).findByText(/transaction-op-0/i), which throws when multiple nodes match the same op label (e.g. virtualized rows plus other UI). Match keyboardNavigationTestSetup by scoping to the virtualized list and using findAllByText for transaction-op- rows. Fixes CI failure in Jest (1) for trace.spec. Fixes BROWSE-411. Made-with: Cursor
1 parent 9622bad commit c33cd46

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,12 +1798,14 @@ describe('trace view', () => {
17981798
}
17991799
);
18001800

1801-
const {container} = render(<TraceView />, {
1801+
render(<TraceView />, {
18021802
initialRouterConfig,
18031803
});
18041804

1805-
// Awaits for the placeholder rendering rows to be removed
1806-
await within(container).findByText(/transaction-op-0/i);
1805+
const virtualizedContainer = getVirtualizedContainer();
1806+
await within(virtualizedContainer).findAllByText(/transaction-op-/i, undefined, {
1807+
timeout: 5000,
1808+
});
18071809

18081810
const searchInput = await screen.findByPlaceholderText('Search in trace');
18091811
await userEvent.type(searchInput, 'op-0');

0 commit comments

Comments
 (0)