Skip to content

Commit

Permalink
fix(OCPADVISOR-87): Don't map cluster operator conditions (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkarat authored Apr 21, 2023
1 parent da55ed7 commit 8e18c5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
9 changes: 1 addition & 8 deletions src/Components/UpgradeRisksTable/ClusterOperatorsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ import { useGetUpgradeRisksQuery } from '../../Services/SmartProxy';
import { Flex, Icon } from '@patternfly/react-core';
import ExclamationTriangleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-triangle-icon';

export const CLUSTER_OPERATOR_LABEL = {
degraded: 'Degraded',
failing: 'Failing',
available: 'Not Available',
upgradeable: 'Not Upgradeable',
};

const ClusterOperatorsList = () => {
const { clusterId } = useParams();
const { data } = useGetUpgradeRisksQuery({ id: clusterId });
Expand Down Expand Up @@ -49,7 +42,7 @@ const ClusterOperatorsList = () => {
<Icon status="warning">
<ExclamationTriangleIcon />
</Icon>
<b>{CLUSTER_OPERATOR_LABEL[condition]}</b>
<b>{condition}</b>
</Flex>
</Td>
<Td class="operators__message">{reason || '-'}</Td>
Expand Down
12 changes: 1 addition & 11 deletions src/Components/UpgradeRisksTable/UpgradeRisksTable.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ const SEVERITY_ICON_CLASS_MAPPING = {
info: 'info',
};

export const CLUSTER_OPERATOR_LABEL_MAPPING = {
degraded: 'Degraded',
failing: 'Failing',
available: 'Not Available',
upgradeable: 'Not Upgradeable',
};

const CLUSTER_ID = '41c30565-b4c9-49f2-a4ce-3277ad22b258';

const mount = (initialEntries = [`/clusters/${CLUSTER_ID}`]) => {
Expand Down Expand Up @@ -130,10 +123,7 @@ describe('successful with some risks', () => {
.should('have.text', condition.name);
cy.get($row)
.find('.operators__status')
.should(
'contain.text',
CLUSTER_OPERATOR_LABEL_MAPPING[condition.condition]
);
.should('contain.text', condition.condition);
cy.get($row)
.find('.operators__status .pf-c-icon__content')
.should('have.class', `pf-m-warning`);
Expand Down

0 comments on commit 8e18c5c

Please sign in to comment.