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' }]));