diff --git a/web/src/client/storage.test.js b/web/src/client/storage.test.js
index 15b15dafd8..5de5f7de06 100644
--- a/web/src/client/storage.test.js
+++ b/web/src/client/storage.test.js
@@ -168,9 +168,10 @@ describe("#proposal", () => {
};
describe("#getData", () => {
- beforeEach(() => {
+ beforeEach(async () => {
contexts.withAvailableDevices();
contexts.withProposal();
+ await client.setUp();
});
it("returns the available devices and the proposal result", async () => {
@@ -181,8 +182,9 @@ describe("#proposal", () => {
});
describe("#getAvailableDevices", () => {
- beforeEach(() => {
+ beforeEach(async () => {
contexts.withAvailableDevices();
+ await client.setUp();
});
it("returns the list of available devices", async () => {
@@ -193,8 +195,9 @@ describe("#proposal", () => {
describe("#getResult", () => {
describe("if there is no proposal yet", () => {
- beforeEach(() => {
+ beforeEach(async () => {
contexts.withoutProposal();
+ await client.setUp();
});
it("returns undefined", async () => {
@@ -204,8 +207,9 @@ describe("#proposal", () => {
});
describe("if there is a proposal", () => {
- beforeEach(() => {
+ beforeEach(async () => {
contexts.withProposal();
+ await client.setUp();
});
it("returns the proposal settings and actions", async () => {
@@ -216,10 +220,11 @@ describe("#proposal", () => {
});
describe("#calculate", () => {
- beforeEach(() => {
+ beforeEach(async () => {
cockpitProxies.proposalCalculator = {
Calculate: jest.fn()
};
+ await client.setUp();
});
it("calculates a default proposal when no settings are given", async () => {
@@ -278,10 +283,11 @@ describe("#proposal", () => {
describe("#iscsi", () => {
describe("#getInitiatorName", () => {
- beforeEach(() => {
+ beforeEach(async () => {
cockpitProxies.iscsiInitiator = {
InitiatorName: "iqn.1996-04.com.suse:01:351e6d6249"
};
+ await client.setUp();
});
it("returns the current initiator name", async () => {
@@ -291,10 +297,11 @@ describe("#iscsi", () => {
});
describe("#setInitiatorName", () => {
- beforeEach(() => {
+ beforeEach(async () => {
cockpitProxies.iscsiInitiator = {
InitiatorName: "iqn.1996-04.com.suse:01:351e6d6249"
};
+ await client.setUp();
});
it("sets the given initiator name", async () => {
@@ -306,8 +313,9 @@ describe("#iscsi", () => {
describe("#getNodes", () => {
describe("if there is no exported iSCSI nodes yet", () => {
- beforeEach(() => {
+ beforeEach(async () => {
contexts.withoutISCSINodes();
+ await client.setUp();
});
it("returns an empty list", async () => {
@@ -317,8 +325,9 @@ describe("#iscsi", () => {
});
describe("if there are exported iSCSI nodes", () => {
- beforeEach(() => {
+ beforeEach(async () => {
contexts.withISCSINodes();
+ await client.setUp();
});
it("returns a list with the exported iSCSI nodes", async () => {
@@ -349,10 +358,11 @@ describe("#iscsi", () => {
});
describe("#discover", () => {
- beforeEach(() => {
+ beforeEach(async () => {
cockpitProxies.iscsiInitiator = {
Discover: jest.fn()
};
+ await client.setUp();
});
it("performs an iSCSI discovery with the given options", async () => {
@@ -373,10 +383,11 @@ describe("#iscsi", () => {
});
describe("#Delete", () => {
- beforeEach(() => {
+ beforeEach(async () => {
cockpitProxies.iscsiInitiator = {
Delete: jest.fn()
};
+ await client.setUp();
});
it("deletes the given iSCSI node", async () => {
diff --git a/web/src/components/overview/StorageSection.test.jsx b/web/src/components/overview/StorageSection.test.jsx
index b66d7c738b..bd7c387c83 100644
--- a/web/src/components/overview/StorageSection.test.jsx
+++ b/web/src/components/overview/StorageSection.test.jsx
@@ -50,7 +50,8 @@ beforeEach(() => {
proposal: { getData: jest.fn().mockResolvedValue(proposal) },
getStatus: jest.fn().mockResolvedValue(status),
getValidationErrors: jest.fn().mockResolvedValue(errors),
- onStatusChange: onStatusChangeFn
+ onStatusChange: onStatusChangeFn,
+ setUp: jest.fn().mockResolvedValue(null)
},
};
});
diff --git a/web/src/components/storage/ProposalTargetSection.test.jsx b/web/src/components/storage/ProposalTargetSection.test.jsx
index c48ad4c29b..88c21cc0c7 100644
--- a/web/src/components/storage/ProposalTargetSection.test.jsx
+++ b/web/src/components/storage/ProposalTargetSection.test.jsx
@@ -109,7 +109,13 @@ describe("when there are no candidate devices available", () => {
it("renders an informative message", () => {
installerRender();
- screen.getByText("No available devices");
+ screen.getByText("No devices found");
+ });
+
+ it("allows configuring iSCSI devices", () => {
+ installerRender();
+
+ screen.getByRole("button", { name: "Configure iSCSI" });
});
it("does not allow configuring the candidate devices", () => {