Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marcushaddon committed Jul 11, 2023
1 parent 0575b1e commit 9615f1d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/core/client/admin/test/moderate/regularQueue.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 8 additions & 1 deletion src/core/client/admin/test/moderate/singleComment.spec.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 9615f1d

Please sign in to comment.