Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Oct 9, 2023
1 parent 4ffed90 commit 687b0b5
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions web/src/components/software/SoftwarePage.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,26 @@
*/

import React from "react";

import { act, screen } from "@testing-library/react";
import { installerRender, mockComponent } from "~/test-utils";
import { installerRender } from "~/test-utils";
import { BUSY, IDLE } from "~/client/status";

import { createClient } from "~/client";

import SoftwarePage from "./SoftwarePage";

const PatternSelectorMock = "<PatternSelector/> Mock";
jest.mock("~/components/software/PatternSelector", () => mockComponent(PatternSelectorMock));
const SkeletonMock = "Skeleton mock";
jest.mock("@patternfly/react-core", () => {
const original = jest.requireActual("@patternfly/react-core");

return {
...original,
Skeleton: () => { return <span>{SkeletonMock}</span> }
};
});

const PatternSelectorMock = "PatternSelector mock";
jest.mock("~/components/software/PatternSelector", () => () => { return PatternSelectorMock });
jest.mock("~/client");
const getStatusFn = jest.fn();
const onStatusChangeFn = jest.fn();
Expand All @@ -44,16 +54,6 @@ 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);
Expand Down

0 comments on commit 687b0b5

Please sign in to comment.