diff --git a/src/components/IOC/IOCTable/IOCTable.spec.js b/src/components/IOC/IOCTable/IOCTable.spec.js index 11002131448012d7fb651e89fb1d9d822062251c..2237395696eaefcccf2574e6eb8feac93f3224a3 100644 --- a/src/components/IOC/IOCTable/IOCTable.spec.js +++ b/src/components/IOC/IOCTable/IOCTable.spec.js @@ -36,8 +36,9 @@ describe("IOCTable", () => { .eq(4) // first row is headers, so get next index .each(($el, index) => { if (index === 0) { - const iconTitle = firstRowData[index]; - cy.wrap($el).findByRole("cell", { name: iconTitle }); + cy.get('[data-testid="Brightness1Icon"]') + .eq(1) + .should("have.attr", "aria-label", firstRowData[index]); } else { cy.wrap($el) .find("p") diff --git a/src/components/common/Status/StatusIcon.js b/src/components/common/Status/StatusIcon.js index 39328084fea52915565924d66ba8196e30c28bc3..da6ff7fc3e24c9a1f4f11fca6de5c696c9f552cd 100644 --- a/src/components/common/Status/StatusIcon.js +++ b/src/components/common/Status/StatusIcon.js @@ -1,12 +1,11 @@ import { object, string } from "prop-types"; import { statusConfig, statusesWithAlerts } from "./StatusData"; -import { LabeledIcon } from "@ess-ics/ce-ui-common"; const propTypes = { alerts: object, status: string }; -statusesWithAlerts.includes(status); + const getLabel = (alerts, status) => { if (statusesWithAlerts.includes(status)) { const warnings = alerts.filter((alert) => alert.type === "WARNING"); @@ -20,14 +19,12 @@ const getLabel = (alerts, status) => { return statusConfig[status].title; }; +const getIcon = (status) => statusConfig[status].icon; + export const StatusIcon = ({ alerts, status }) => { - return ( - <LabeledIcon - label={getLabel(alerts, status)} - Icon={statusConfig[status].icon} - labelPosition="none" - /> - ); + const Icon = getIcon(status); + + return <Icon aria-label={getLabel(alerts, status)} />; }; StatusIcon.propTypes = propTypes; diff --git a/src/components/host/HostTable.spec.js b/src/components/host/HostTable.spec.js index 506972d3cd9a576efbe58d64e6d35f3a9535296b..5ad3da3dd8906568fd57931d9af2592972358bb2 100644 --- a/src/components/host/HostTable.spec.js +++ b/src/components/host/HostTable.spec.js @@ -36,8 +36,9 @@ describe("HostTable", () => { .eq(1) // first row is headers, so get next index .each(($el, index) => { if (index === 0) { - const iconTitle = firstRowData[index]; - cy.wrap($el).findByRole("img", { name: iconTitle }); + cy.get('[data-testid="Brightness1Icon"]') + .eq(0) + .should("have.attr", "aria-label", firstRowData[index]); } else { cy.wrap($el) .find("p")