Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Oct 8, 2023
1 parent 4ffed90 commit 4f3eefd
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions web/src/components/software/SoftwarePage.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ import { createClient } from "~/client";

import SoftwarePage from "./SoftwarePage";

jest.mock("@patternfly/react-core", () => {
const original = jest.requireActual("@patternfly/react-core");

return {
...original,
Skeleton: mockComponent("<Skeleton/> mock")
};
});

const PatternSelectorMock = "<PatternSelector/> Mock";
jest.mock("~/components/software/PatternSelector", () => mockComponent(PatternSelectorMock));
jest.mock("~/client");
Expand All @@ -44,21 +53,11 @@ beforeEach(() => {
});
});

const SkeletonMock = "<Skeleton/> mock";
jest.mock("@patternfly/react-core", () => {
const original = jest.requireActual("@patternfly/react-core");

return {
...original,
Skeleton: mockComponent(SkeletonMock)
};
});

describe("SoftwarePage", () => {
it("displays a progress when the backend in busy", async () => {
getStatusFn.mockResolvedValue(BUSY);
await act(async () => installerRender(<SoftwarePage />));
screen.getAllByText(SkeletonMock);
screen.getAllByText("<Skeleton/> mock");
});

it("displays the PatternSelector when the backend in ready", async () => {
Expand Down

0 comments on commit 4f3eefd

Please sign in to comment.