diff --git a/src/core/client/admin/test/moderate/regularQueue.spec.tsx b/src/core/client/admin/test/moderate/regularQueue.spec.tsx index 918495f47b..baede8fa47 100644 --- a/src/core/client/admin/test/moderate/regularQueue.spec.tsx +++ b/src/core/client/admin/test/moderate/regularQueue.spec.tsx @@ -578,6 +578,12 @@ it("renders reported queue with comments and load more", async () => { expect(screen.queryByRole("button", { name: "Load More" })).toBeNull(); }); + await waitFor(() => { + expect( + screen.getByTestId(`moderate-comment-card-${reportedComments[2].id}`) + ).toBeInTheDocument(); + }); + // Verify we have one more item now. const comments = screen.getAllByTestId(/^moderate-comment-card-.*$/); expect(comments.length).toBe(previousCount + 1); diff --git a/src/core/client/admin/test/moderate/singleComment.spec.tsx b/src/core/client/admin/test/moderate/singleComment.spec.tsx index 967ae49b18..dc3c0e524c 100644 --- a/src/core/client/admin/test/moderate/singleComment.spec.tsx +++ b/src/core/client/admin/test/moderate/singleComment.spec.tsx @@ -1,4 +1,4 @@ -import { screen, within } from "@testing-library/react"; +import { screen, waitFor, within } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { pureMerge } from "coral-common/utils"; @@ -82,6 +82,13 @@ it("renders single comment view with story info", async () => { const singleModerateContainer = await screen.findByTestId( "single-moderate-container" ); + + await waitFor(() => { + expect( + screen.getByTestId(`moderate-comment-card-${reportedComments[0].id}`) + ).toBeInTheDocument(); + }); + expect( within(singleModerateContainer).queryByText("Comment On") ).toBeInTheDocument();