Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions web/src/components/storage/ConnectedDevicesMenu.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { installerRender, mockNavigateFn } from "~/test-utils";
import ConnectedDevicesMenu from "./ConnectedDevicesMenu";
import { STORAGE as PATHS } from "~/routes/paths";

const mockUseZFCPSupported = jest.fn();
/*const mockUseZFCPSupported = jest.fn();
jest.mock("~/queries/storage/zfcp", () => ({
...jest.requireActual("~/queries/storage/zfcp"),
useZFCPSupported: () => mockUseZFCPSupported(),
Expand All @@ -37,17 +37,20 @@ jest.mock("~/queries/storage/dasd", () => ({
...jest.requireActual("~/queries/storage/dasd"),
useDASDSupported: () => mockUseDASDSupported(),
}));
*/

const mockReactivateSystem = jest.fn();
jest.mock("~/api", () => ({
...jest.requireActual("~/api"),
activateStorageAction: () => mockReactivateSystem(),
}));

/*
beforeEach(() => {
mockUseZFCPSupported.mockReturnValue(false);
mockUseDASDSupported.mockReturnValue(false);
});
*/

async function openMenu() {
const { user } = installerRender(<ConnectedDevicesMenu />);
Expand Down Expand Up @@ -78,9 +81,11 @@ it("allows users to configure iSCSI", async () => {
});

describe("if zFCP is not supported", () => {
/*
beforeEach(() => {
mockUseZFCPSupported.mockReturnValue(false);
});
*/

it("does not allow users to configure zFCP", async () => {
const { menu } = await openMenu();
Expand All @@ -89,10 +94,12 @@ describe("if zFCP is not supported", () => {
});
});

describe("if zFCP is supported", () => {
describe.skip("if zFCP is supported", () => {
/*
beforeEach(() => {
mockUseZFCPSupported.mockReturnValue(true);
});
*/

it("allows users to configure zFCP", async () => {
const { user, menu } = await openMenu();
Expand All @@ -103,9 +110,11 @@ describe("if zFCP is supported", () => {
});

describe("if DASD is not supported", () => {
/*
beforeEach(() => {
mockUseDASDSupported.mockReturnValue(false);
});
*/

it("does not allow users to configure DASD", async () => {
const { menu } = await openMenu();
Expand All @@ -114,10 +123,12 @@ describe("if DASD is not supported", () => {
});
});

describe("if DASD is supported", () => {
describe.skip("if DASD is supported", () => {
/*
beforeEach(() => {
mockUseDASDSupported.mockReturnValue(true);
});
*/

it("allows users to configure DASD", async () => {
const { user, menu } = await openMenu();
Expand Down
6 changes: 2 additions & 4 deletions web/src/components/storage/ConnectedDevicesMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@ import { useNavigate } from "react-router";
import { _ } from "~/i18n";
import { activateStorageAction } from "~/api";
import { STORAGE as PATHS } from "~/routes/paths";
import { useZFCPSupported } from "~/queries/storage/zfcp";
import { useDASDSupported } from "~/queries/storage/dasd";
import { Icon } from "~/components/layout";
import MenuButton from "../core/MenuButton";
import spacingStyles from "@patternfly/react-styles/css/utilities/Spacing/spacing";

export default function ConnectedDevicesMenu() {
const navigate = useNavigate();
const isZFCPSupported = useZFCPSupported();
const isDASDSupported = useDASDSupported();
const isZFCPSupported = false;
const isDASDSupported = false;

return (
<MenuButton
Expand Down
Loading