Skip to content

Commit

Permalink
removed waitForLoading from test utils and put back the code I was us…
Browse files Browse the repository at this point in the history
…ing earlier. Tests were failing with WaitforLoading
  • Loading branch information
Fernando Cremer authored and Fernando Cremer committed Nov 3, 2023
1 parent 25975b0 commit 0c4fb24
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugins/github-issues/src/components/Issues.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { render, screen } from "@testing-library/react";
import { render, screen, waitFor } from "@testing-library/react";
import Issues from "./Issues";
import { waitForLoading } from "../../../testUtils/testUtils";

Expand Down Expand Up @@ -203,7 +203,9 @@ describe("Issues", () => {

render(<Issues entityYaml={serviceYaml} />);
expect(screen.queryByText("Loading")).toBeInTheDocument();
await waitForLoading();
await waitFor(() => {
expect(screen.queryByText("Loading")).not.toBeInTheDocument();
});
expect(screen.queryByText("Number")).toBeInTheDocument();
expect(screen.queryByText("1347")).toBeInTheDocument();
});
Expand All @@ -218,7 +220,9 @@ describe("Issues", () => {
render(<Issues entityYaml={serviceYaml} />);
expect(screen.queryByText("Loading")).toBeInTheDocument();

await waitForLoading();
await waitFor(() => {
expect(screen.queryByText("Loading")).not.toBeInTheDocument();
});
expect(
screen.queryByText(
"We could not find any issues associated with this entity"
Expand Down

0 comments on commit 0c4fb24

Please sign in to comment.