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
5 changes: 5 additions & 0 deletions web/package/agama-web-ui.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Feb 27 14:39:08 UTC 2026 - David Diaz <dgonzalez@suse.com>

- Do not show empty software page (related to bsc#1258922).

-------------------------------------------------------------------
Thu Feb 26 16:43:44 UTC 2026 - David Diaz <dgonzalez@suse.com>

Expand Down
19 changes: 18 additions & 1 deletion web/src/components/software/SoftwarePage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import testingPatterns from "./patterns.test.json";
import testingProposal from "./proposal.test.json";
import SoftwarePage from "./SoftwarePage";

const mockProposal = jest.fn();

jest.mock("~/components/layout/Header", () => () => <div>Header Mock</div>);
jest.mock("~/components/questions/Questions", () => () => <div>Questions Mock</div>);

Expand All @@ -35,14 +37,18 @@ jest.mock("~/hooks/model/issue", () => ({
}));

jest.mock("~/hooks/model/proposal/software", () => ({
useProposal: () => testingProposal,
useProposal: () => mockProposal(),
}));

jest.mock("~/hooks/model/system/software", () => ({
useSystem: () => ({ patterns: testingPatterns }),
}));

describe("SoftwarePage", () => {
beforeEach(() => {
mockProposal.mockReturnValue(testingProposal);
});

it("renders a list of selected patterns", () => {
installerRender(<SoftwarePage />);
screen.getAllByText(/GNOME/);
Expand All @@ -64,4 +70,15 @@ describe("SoftwarePage", () => {
installerRender(<SoftwarePage />);
screen.getByRole("link", { name: "Change selection" });
});

describe("when there is no proposal yet", () => {
beforeEach(() => {
mockProposal.mockReturnValue(null);
});

it("renders an informative messsage", () => {
installerRender(<SoftwarePage />);
screen.getByText("No information available yet");
});
});
});
3 changes: 2 additions & 1 deletion web/src/components/software/SoftwarePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
DescriptionListDescription,
DescriptionListGroup,
DescriptionListTerm,
EmptyState,
Grid,
GridItem,
Spinner,
Expand Down Expand Up @@ -139,7 +140,7 @@ const Content = () => {
const [loading, setLoading] = useState(false);

if (!proposal) {
return null;
return <EmptyState headingLevel="h2" titleText={_("No information available yet")} />;
}

// FIXME: temporarily disabled, the API end point is not implemented yet
Expand Down
Loading