Skip to content

Commit

Permalink
Enable ChecksResultOverview links to filter on target
Browse files Browse the repository at this point in the history
  • Loading branch information
rtorrero committed Oct 10, 2022
1 parent e6937d2 commit 577cc7d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
14 changes: 11 additions & 3 deletions assets/js/components/ClusterDetails/ChecksResultOverview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,18 @@ const ChecksResultOverview = ({
</h6>

<div className="flex flex-col self-start w-full px-4 mt-2">
<CheckResult onClick={onCheckClick} value={passing} result="passing" />
<CheckResult onClick={onCheckClick} value={warning} result="warning" />
<CheckResult
onClick={onCheckClick}
onClick={() => onCheckClick('passing')}
value={passing}
result="passing"
/>
<CheckResult
onClick={() => onCheckClick('warning')}
value={warning}
result="warning"
/>
<CheckResult
onClick={() => onCheckClick('critical')}
value={critical}
result="critical"
/>
Expand Down
4 changes: 2 additions & 2 deletions assets/js/components/ClusterDetails/ClusterDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ const ClusterDetails = () => {
<div className="tn-cluster-checks-overview mt-4 bg-white shadow rounded-lg py-4 xl:w-1/4 w-full">
<ChecksResultOverview
{...checkResults}
onCheckClick={() =>
navigate(`/clusters/${clusterID}/checks/results`)
onCheckClick={(health) =>
navigate(`/clusters/${clusterID}/checks/results?health=${health}`)
}
/>
</div>
Expand Down
27 changes: 27 additions & 0 deletions test/e2e/cypress/integration/hana_cluster_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,40 @@ context('HANA database details', () => {
cy.get('.tn-cluster-checks-overview ').contains('Passing');
});

it('should have a working link to the passing checks in the overview component', () => {
cy.get('.tn-cluster-checks-overview ').contains('Passing').click();
cy.url().should(
'include',
`/clusters/${availableHanaCluster.id}/checks/results?health=passing`
);
cy.go('back');
});

it('should have the check overview component with warning checks', () => {
cy.get('.tn-cluster-checks-overview ').contains('Warning');
});

it('should have a working link to the warning checks in the overview component', () => {
cy.get('.tn-cluster-checks-overview ').contains('Warning').click();
cy.url().should(
'include',
`/clusters/${availableHanaCluster.id}/checks/results?health=warning`
);
cy.go('back');
});

it('should have the check overview component with critical checks', () => {
cy.get('.tn-cluster-checks-overview ').contains('Critical');
});

it('should have a working link to the critical checks in the overview component', () => {
cy.get('.tn-cluster-checks-overview ').contains('Critical').click();
cy.url().should(
'include',
`/clusters/${availableHanaCluster.id}/checks/results?health=critical`
);
cy.go('back');
});
});

describe('Cluster sites should have the expected hosts', () => {
Expand Down

0 comments on commit 577cc7d

Please sign in to comment.