diff --git a/web/src/components/storage/InstallationDeviceField.test.jsx b/web/src/components/storage/InstallationDeviceField.test.jsx index 2b3d1fc234..13ffa9a570 100644 --- a/web/src/components/storage/InstallationDeviceField.test.jsx +++ b/web/src/components/storage/InstallationDeviceField.test.jsx @@ -26,6 +26,15 @@ import { screen, within } from "@testing-library/react"; import { installerRender } from "~/test-utils"; import InstallationDeviceField from "~/components/storage/InstallationDeviceField"; +jest.mock("@patternfly/react-core", () => { + const original = jest.requireActual("@patternfly/react-core"); + + return { + ...original, + Skeleton: () =>
PF-Skeleton
+ }; +}); + /** * @typedef {import ("~/components/storage/InstallationDeviceField").InstallationDeviceFieldProps} InstallationDeviceFieldProps * @typedef {import ("~/client/storage").StorageDevice} StorageDevice @@ -97,10 +106,10 @@ describe("when set as loading", () => { }); it("renders a loading hint", () => { - const { container } = installerRender(); + installerRender(); // a PF skeleton is displayed - expect(container.querySelector("div.pf-v5-c-skeleton")).toBeVisible(); + screen.getByText("PF-Skeleton"); }); });