-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add SMFID to Jobs Tree View #2629
Changes from 7 commits
bfb2479
bdd79b3
27667a8
ce4e4b7
cd9d0d0
c5e9720
1e281bc
f47317a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -302,7 +302,6 @@ describe("ZoweJobNode unit tests - Function getChildren", () => { | |||||
await globalMocks.testJobsProvider.addSession("fake"); | ||||||
|
||||||
const jobs = await globalMocks.testJobsProvider.mSessionNodes[1].getChildren(); | ||||||
|
||||||
expect(jobs.length).toBe(2); | ||||||
expect(jobs[0].job.jobid).toEqual(globalMocks.testIJob.jobid); | ||||||
expect(jobs[0].tooltip).toEqual("TESTJOB(JOB1234)"); | ||||||
|
@@ -324,7 +323,7 @@ describe("ZoweJobNode unit tests - Function getChildren", () => { | |||||
globalMocks.testJobsProvider.mSessionNodes[1].dirty = true; | ||||||
const newJobs = await globalMocks.testJobsProvider.mSessionNodes[1].getChildren(); | ||||||
|
||||||
expect(newJobs[0].label).toEqual("TESTJOB(JOB1234) - CC 0000"); | ||||||
expect(newJobs[0].label).toEqual("TESTJOB(JOB1234) - sampleMember - CC 0000"); | ||||||
}); | ||||||
|
||||||
it("Tests that getChildren retrieves only child jobs which match a provided searchId", async () => { | ||||||
|
@@ -423,6 +422,44 @@ describe("ZoweJobNode unit tests - Function getChildren", () => { | |||||
const jobs = await globalMocks.testJobsProvider.mSessionNodes[1].getChildren(); | ||||||
expect(jobs).toEqual(expectedJob); | ||||||
}); | ||||||
|
||||||
it("To check smfid field in Jobs Tree View", async () => { | ||||||
const globalMocks = await createGlobalMocks(); | ||||||
|
||||||
await globalMocks.testJobsProvider.addSession("fake"); | ||||||
globalMocks.testJobsProvider.mSessionNodes[1].searchId = "JOB1234"; | ||||||
globalMocks.testJobsProvider.mSessionNodes[1].dirty = true; | ||||||
globalMocks.testJobsProvider.mSessionNodes[1].filtered = true; | ||||||
globalMocks.testIJob.retcode = "ACTIVE"; | ||||||
|
||||||
const jobs = await globalMocks.testJobsProvider.mSessionNodes[1].getChildren(); | ||||||
expect(jobs[0].label).toEqual("TESTJOB(JOB1234) - sampleMember - ACTIVE"); | ||||||
}); | ||||||
|
||||||
it("smfid field is not in Jobs Tree View", async () => { | ||||||
const globalMocks = await createGlobalMocks(); | ||||||
|
||||||
await globalMocks.testJobsProvider.addSession("fake"); | ||||||
globalMocks.testJobsProvider.mSessionNodes[1].searchId = "JOB1234"; | ||||||
globalMocks.testJobsProvider.mSessionNodes[1].dirty = true; | ||||||
globalMocks.testJobsProvider.mSessionNodes[1].filtered = true; | ||||||
globalMocks.testIJob.retcode = "ACTIVE"; | ||||||
globalMocks.testIJob["exec-member"] = ""; | ||||||
const jobs = await globalMocks.testJobsProvider.mSessionNodes[1].getChildren(); | ||||||
expect(jobs[0].label).toEqual("TESTJOB(JOB1234) - ACTIVE"); | ||||||
}); | ||||||
|
||||||
it("To check smfid field when return code is undefined", async () => { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I might be misinterpreting the name for this test case, but I believe that the test code is checking for the opposite scenario:
Suggested change
|
||||||
const globalMocks = await createGlobalMocks(); | ||||||
|
||||||
await globalMocks.testJobsProvider.addSession("fake"); | ||||||
globalMocks.testJobsProvider.mSessionNodes[1].searchId = "JOB1234"; | ||||||
globalMocks.testJobsProvider.mSessionNodes[1].dirty = true; | ||||||
globalMocks.testJobsProvider.mSessionNodes[1].filtered = true; | ||||||
|
||||||
const jobs = await globalMocks.testJobsProvider.mSessionNodes[1].getChildren(); | ||||||
expect(jobs[0].label).toEqual("TESTJOB(JOB1234) - ACTIVE"); | ||||||
}); | ||||||
}); | ||||||
|
||||||
describe("ZoweJobNode unit tests - Function flipState", () => { | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -203,7 +203,10 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { | |
jobs.forEach((job) => { | ||
let nodeTitle: string; | ||
if (job.retcode) { | ||
nodeTitle = `${job.jobname}(${job.jobid}) - ${job.retcode}`; | ||
nodeTitle = | ||
job["exec-member"] !== undefined && job["exec-member"] !== "" | ||
? `${job.jobname}(${job.jobid}) - ${job["exec-member"] as string} - ${job.retcode}` | ||
: `${job.jobname}(${job.jobid}) - ${job.retcode}`; | ||
Comment on lines
+206
to
+209
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the future, we might benefit from an exported function that builds these labels - primarily so it can be used to build job labels in tests. |
||
} else { | ||
nodeTitle = `${job.jobname}(${job.jobid}) - ${job.status}`; | ||
} | ||
|
@@ -374,6 +377,7 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { | |
owner, | ||
prefix, | ||
status, | ||
execData: "Y", | ||
}); | ||
} else { | ||
this.statusNotSupportedMsg(status); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed a pattern across the new tests in this file. For the future, we might benefit from a test function that condenses this pattern, calling it with the appropriate arguments: