Skip to content

Commit

Permalink
web: Fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
joseivanlopez committed May 14, 2024
1 parent 477c1d8 commit bff1618
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 2 additions & 4 deletions web/src/components/core/IssuesDialog.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) [2023] SUSE LLC
* Copyright (c) [2023-2024] SUSE LLC
*
* All Rights Reserved.
*
Expand Down Expand Up @@ -35,13 +35,11 @@ import { _ } from "~/i18n";
* @param {import ("~/client/mixins").Issue} props.issue
*/
const IssueItem = ({ issue }) => {
const hasDetails = issue.details.length > 0;

return (
<li>
{issue.description}
<If
condition={hasDetails}
condition={issue.details}
then={<pre>{issue.details}</pre>}
/>
</li>
Expand Down
5 changes: 3 additions & 2 deletions web/src/components/core/IssuesDialog.test.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) [2023] SUSE LLC
* Copyright (c) [2023-2024] SUSE LLC
*
* All Rights Reserved.
*
Expand Down Expand Up @@ -38,7 +38,7 @@ const issues = {
product: [],
storage: [
{ description: "storage issue 1", details: "Details 1", source: "system", severity: "warn" },
{ description: "storage issue 2", details: "Details 2", source: "config", severity: "error" }
{ description: "storage issue 2", details: null, source: "config", severity: "error" }
],
software: [
{ description: "software issue 1", details: "Details 1", source: "system", severity: "warn" }
Expand All @@ -62,6 +62,7 @@ it("loads the issues", async () => {
installerRender(<IssuesDialog isOpen sectionId="storage" title="Storage issues" />);

await screen.findByText(/storage issue 1/);
await screen.findByText(/storage issue 2/);
});

it('calls onClose callback when close button is clicked', async () => {
Expand Down

0 comments on commit bff1618

Please sign in to comment.