From 22bae10ec34b17f7efa7e2f509bd58fcf551fe43 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 7 Jan 2025 12:18:03 -0500 Subject: [PATCH 1/2] Fixes for console logging. --- client/src/components/JobInformation/JobInformation.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/components/JobInformation/JobInformation.vue b/client/src/components/JobInformation/JobInformation.vue index 22871692e6fe..8e63e8dea2eb 100644 --- a/client/src/components/JobInformation/JobInformation.vue +++ b/client/src/components/JobInformation/JobInformation.vue @@ -39,11 +39,15 @@ const stderr_position = computed(() => stderr_text.value.length); const runTime = computed(() => getJobDuration(job.value)); function jobStateIsTerminal(jobState) { - return jobState && !NON_TERMINAL_STATES.includes(job.value.state); + return jobState && !NON_TERMINAL_STATES.includes(jobState); } -const jobIsTerminal = computed(() => jobStateIsTerminal(job?.value?.state)); +function jobStateIsRunning(jobState) { + return jobState == "running"; +} +const jobIsTerminal = computed(() => jobStateIsTerminal(job?.value?.state)); +const jobIsRunning = computed(() => jobStateIsRunning(job?.value?.state)); const routeToInvocation = computed(() => `/workflows/invocations/${invocationId.value}`); const metadataDetail = ref({ @@ -127,6 +131,7 @@ watch(
Date: Thu, 9 Jan 2025 10:56:39 +0200 Subject: [PATCH 2/2] Adjust client unit tests to conditional console rendering --- client/src/components/JobInformation/JobInformation.test.js | 5 +++-- .../JobInformation/testData/jobInformationResponse.json | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/components/JobInformation/JobInformation.test.js b/client/src/components/JobInformation/JobInformation.test.js index 68602a1b6ffd..29f3f8d604b3 100644 --- a/client/src/components/JobInformation/JobInformation.test.js +++ b/client/src/components/JobInformation/JobInformation.test.js @@ -67,8 +67,8 @@ describe("JobInformation/JobInformation.vue", () => { // table should exist expect(jobInfoTable).toBeTruthy(); const rows = jobInfoTable.findAll("tr"); - // should contain 9 rows - expect(rows.length).toBe(9); + // should contain 10 rows + expect(rows.length).toBe(10); }); it("stdout and stderr should be rendered", async () => { @@ -96,5 +96,6 @@ describe("JobInformation/JobInformation.vue", () => { { id: "encoded-copied-from-job-id", backend_key: "copied_from_job_id" }, ]; verifyValues(rendered_entries, jobInfoTable, jobResponse); + expect(wrapper.find('td[data-description="galaxy-job-state"]').exists()).toBe(true); }); }); diff --git a/client/src/components/JobInformation/testData/jobInformationResponse.json b/client/src/components/JobInformation/testData/jobInformationResponse.json index a53d9efa9108..4a74f832272d 100644 --- a/client/src/components/JobInformation/testData/jobInformationResponse.json +++ b/client/src/components/JobInformation/testData/jobInformationResponse.json @@ -7,5 +7,6 @@ "command_line": "commandline", "job_messages": ["test-msg1", "test-msg2", "test-msg3", "test-msg4"], "id": "test_id", - "copied_from_job_id": "test_copied_from_job_id" + "copied_from_job_id": "test_copied_from_job_id", + "state": "running" }