Skip to content

Commit 934e95a

Browse files
Add "Last Change" column to cluster details (#136)
1 parent 6ac2c7c commit 934e95a

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

apps/cluster-orch/src/components/pages/ClusterDetail/ClusterDetail.cy.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
*/
55

66
import { aggregateStatuses, ApiErrorPom } from "@orch-ui/components";
7+
import { cyGet } from "@orch-ui/tests";
78
import {
89
ClusterGenericStatuses,
910
clusterToStatuses,
1011
IRuntimeConfig,
1112
} from "@orch-ui/utils";
13+
import moment from "moment";
1214
import ClusterDetail from "./ClusterDetail";
1315
import { ClusterDetailPom } from "./ClusterDetail.pom";
1416

@@ -63,6 +65,17 @@ describe("<ClusterDetail />", () => {
6365
);
6466
});
6567

68+
it("should render 'Last Change' column when showTimestamp is true", () => {
69+
const timestamp = pom.testCluster.providerStatus?.timestamp as number;
70+
const expectedDate = moment(new Date(timestamp * 1000)).format(
71+
"MMM DD, YYYY",
72+
);
73+
cyGet("timestamp-lifecyclePhase").should("contain", expectedDate);
74+
cyGet("timestamp-lifecyclePhase").should("exist");
75+
cyGet("last-change").should("exist");
76+
cyGet("last-change").contains("Last Change");
77+
});
78+
6679
it("should delete a cluster", () => {
6780
pom.el.clusterDetailPopup.click().as("popup");
6881
cy.get("@popup").contains("Delete").click();

apps/cluster-orch/src/components/pages/ClusterDetail/ClusterDetail.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ function ClusterDetail({ hasHeader = true, name }: ClusterDetailProps) {
446446
<DetailedStatuses
447447
data={clusterToStatuses(clusterDetail)}
448448
statusFields={clusterStatusFields}
449+
showTimestamp
449450
/>
450451
</Item>
451452
<Item title={<Text>Hosts</Text>}>

0 commit comments

Comments
 (0)