diff --git a/static/gsApp/components/upsellProvider.spec.tsx b/static/gsApp/components/upsellProvider.spec.tsx index 1c486d9f0707..af8d09ec340d 100644 --- a/static/gsApp/components/upsellProvider.spec.tsx +++ b/static/gsApp/components/upsellProvider.spec.tsx @@ -8,6 +8,7 @@ import { renderGlobalModal, screen, userEvent, + waitFor, } from 'sentry-test/reactTestingLibrary'; import type {Organization} from 'sentry/types/organization'; @@ -96,10 +97,9 @@ describe('UpsellProvider', () => { }); await userEvent.click(screen.getByTestId('test-render')); - await tick(); + await waitFor(() => expect(handleTrialStarted).toHaveBeenCalled()); expect(startTrialMock).toHaveBeenCalled(); - expect(handleTrialStarted).toHaveBeenCalled(); }); it('with billing scope redirect to sub page', async () => { @@ -221,9 +221,8 @@ describe('UpsellProvider', () => { } ); await userEvent.click(screen.getByTestId('test-render')); - await tick(); - expect(screen.getByTestId('confirm-content')).toBeInTheDocument(); + expect(await screen.findByTestId('confirm-content')).toBeInTheDocument(); expect(handleTrialStarted).not.toHaveBeenCalled(); expect(startTrialMock).not.toHaveBeenCalled();