From b98073ee8fed1f90b92c6a920a051503264c1b66 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 5 Jan 2023 17:32:04 -0600 Subject: [PATCH] Fix ReportModal test --- .../modals/report-modal/__tests__/report-modal.test.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/soapbox/features/ui/components/modals/report-modal/__tests__/report-modal.test.tsx b/app/soapbox/features/ui/components/modals/report-modal/__tests__/report-modal.test.tsx index a2dee08b52..269f97146c 100644 --- a/app/soapbox/features/ui/components/modals/report-modal/__tests__/report-modal.test.tsx +++ b/app/soapbox/features/ui/components/modals/report-modal/__tests__/report-modal.test.tsx @@ -4,7 +4,7 @@ import React from 'react'; import { __stub } from 'soapbox/api'; -import { render, screen } from '../../../../../../jest/test-helpers'; +import { render, screen, waitFor } from '../../../../../../jest/test-helpers'; import { normalizeAccount, normalizeStatus } from '../../../../../../normalizers'; import ReportModal from '../report-modal'; @@ -64,6 +64,9 @@ describe('', () => { await user.click(screen.getByTestId('rule-1')); await user.click(screen.getByText(/Next/)); await user.click(screen.getByText(/Submit/)); - expect(screen.getByText(/Thanks for submitting your report/)).toBeInTheDocument(); + + await waitFor(() => { + expect(screen.getByText(/Thanks for submitting your report/)).toBeInTheDocument(); + }); }); });