diff --git a/.changeset/witty-meals-know.md b/.changeset/witty-meals-know.md new file mode 100644 index 0000000000..5545cc4550 --- /dev/null +++ b/.changeset/witty-meals-know.md @@ -0,0 +1,5 @@ +--- +"@cloudoperators/juno-ui-components": patch +--- + +feat(ui): remove `success` icon, return `check circle´ instead when `success` is called diff --git a/packages/ui-components/src/components/Icon/Icon.component.tsx b/packages/ui-components/src/components/Icon/Icon.component.tsx index 4eef4f9df6..1b93bb1f71 100644 --- a/packages/ui-components/src/components/Icon/Icon.component.tsx +++ b/packages/ui-components/src/components/Icon/Icon.component.tsx @@ -48,7 +48,6 @@ import NotificationsOff from "@material-design-icons/svg/outlined/notifications_ import OpenInBrowser from "@material-design-icons/svg/outlined/open_in_browser.svg" import OpenInNew from "@material-design-icons/svg/outlined/open_in_new.svg" import Place from "./icons/place.svg" -import Success from "@material-design-icons/svg/filled/check_box.svg" import Search from "@material-design-icons/svg/outlined/search.svg" import SeverityLow from "./icons/juno_severity_low.svg" import SeverityMedium from "./icons/juno_severity_medium.svg" @@ -812,8 +811,10 @@ const getColoredSizedIcon = ({ icon, color, size, title, iconClassName, ...iconP /> ) case KnownIconsEnum.success: + // `success` (check_box.svg) has been deprecated in favour of `checkCircle` to avoid visual inconsistency. + // The `success` name is kept as a valid alias so existing callers continue to work. return ( - { expect(screen.getByRole("img")).toHaveAttribute("alt", "success") }) + test("renders checkCircle when calling success (success has been deprecated in favour of checkCircle)", () => { + const { container: successContainer } = render() + const { container: checkCircleContainer } = render() + const successPath = successContainer.querySelector("svg path")?.getAttribute("d") + const checkCirclePath = checkCircleContainer.querySelector("svg path")?.getAttribute("d") + expect(successPath).toEqual(checkCirclePath) + }) + test("renders a warning icon", () => { render() expect(screen.getByRole("img")).toBeInTheDocument()