From 82321049eff12d3d224c040c413e165381c36f49 Mon Sep 17 00:00:00 2001 From: Brian Smith <112954497+brian-smith-tcril@users.noreply.github.com> Date: Wed, 2 Dec 2026 15:35:09 -0500 Subject: [PATCH] test: wait for the tour dialog before finding its button by name Co-Authored-By: Claude Fable 5.2 --- src/product-tours/ProductTours.test.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/product-tours/ProductTours.test.jsx b/src/product-tours/ProductTours.test.jsx index 26435a071d..8220cd7a82 100644 --- a/src/product-tours/ProductTours.test.jsx +++ b/src/product-tours/ProductTours.test.jsx @@ -207,6 +207,9 @@ describe('Course Home Tours', () => { it('completes the existing-user tour', async () => { const user = userEvent.setup(); + // A cheap wait first: polling for the button by name starves the render under load. + await screen.findByRole('dialog'); + await user.click(await screen.findByRole('button', { name: 'Okay' })); expect(sendTrackEvent).toHaveBeenCalledWith('edx.ui.lms.existing_user_tour.completed', expect.any(Object)); await waitFor(() => expect(patches()).toEqual([{ course_home_tour_status: 'no-tour' }]));