From d41700a57a5d63c2108badb650455bdeb7885e32 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Fri, 10 Jan 2025 14:14:38 -0500 Subject: [PATCH] tests: add coverage for new job properties Signed-off-by: Trae Yelovich --- .../__tests__/__mocks__/mockCreators/jobs.ts | 4 +++- .../__unit__/trees/job/JobTableView.unit.test.ts | 8 ++++++++ packages/zowe-explorer/src/trees/job/JobTableView.ts | 1 - 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/zowe-explorer/__tests__/__mocks__/mockCreators/jobs.ts b/packages/zowe-explorer/__tests__/__mocks__/mockCreators/jobs.ts index 5c787e51a1..ecc5427f59 100644 --- a/packages/zowe-explorer/__tests__/__mocks__/mockCreators/jobs.ts +++ b/packages/zowe-explorer/__tests__/__mocks__/mockCreators/jobs.ts @@ -45,7 +45,9 @@ export function createIJobObject() { type: "JOB", url: "fake/url", "exec-member": "sampleMember", - "exec-ended": "2024-03-07T00:04:67:980z", + "exec-ended": "2024-03-07T00:04:27:980z", + "exec-started": "2024-03-06T00:04:27:100z", + "exec-submitted": "2024-03-07T00:04:07:000z", }; } diff --git a/packages/zowe-explorer/__tests__/__unit__/trees/job/JobTableView.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/trees/job/JobTableView.unit.test.ts index 0962a2b7a0..850d5a01db 100644 --- a/packages/zowe-explorer/__tests__/__unit__/trees/job/JobTableView.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/trees/job/JobTableView.unit.test.ts @@ -208,5 +208,13 @@ describe("JobTableView unit tests", () => { const expectedProperties = { ...blockMocks.jobNode.job }; expect((JobTableView as any).jobPropertiesFor(blockMocks.jobNode)).toStrictEqual(expectedProperties); }); + + it("returns exec-started, exec-submitted and exec-ended properties from the job node", () => { + const blockMocks = getBlockMocks(); + const jobProperties = (JobTableView as any).jobPropertiesFor(blockMocks.jobNode); + expect(jobProperties).toHaveProperty("exec-started"); + expect(jobProperties).toHaveProperty("exec-submitted"); + expect(jobProperties).toHaveProperty("exec-ended"); + }); }); }); diff --git a/packages/zowe-explorer/src/trees/job/JobTableView.ts b/packages/zowe-explorer/src/trees/job/JobTableView.ts index 4dcf293513..1925fa3e73 100644 --- a/packages/zowe-explorer/src/trees/job/JobTableView.ts +++ b/packages/zowe-explorer/src/trees/job/JobTableView.ts @@ -205,7 +205,6 @@ export class JobTableView { await this.table.setTitle(this.buildTitle(profileNode)); await this.table.setContent(jobProperties); } else { - const jobProperties = JobTableView.cachedChildren.map((item) => this.jobPropertiesFor(item)); this.table = new TableBuilder(context) .options({ autoSizeStrategy: { type: "fitCellContents" },