Skip to content

Commit e581ad8

Browse files
committed
HARMONY-1998: Test message_category display
1 parent b76d306 commit e581ad8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

services/harmony/app/frontends/workflow-ui.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ function workItemRenderingFunctions(job: Job, isAdmin: boolean, isLogViewer: boo
484484
badgeClasses[WorkItemStatus.WARNING] = 'warning';
485485
return {
486486
workflowItemBadge(): string { return badgeClasses[this.status]; },
487-
workflowItemStatus(): string { return this.sub_status ? `${this.status}: ${this.sub_status}` : this.status; },
487+
workflowItemStatus(): string { return this.message_category ? `${this.status}: ${this.message_category}` : this.status; },
488488
workflowItemStep(): string { return sanitizeImage(this.serviceID); },
489489
workflowItemCreatedAt(): string { return this.createdAt.getTime(); },
490490
workflowItemUpdatedAt(): string { return this.updatedAt.getTime(); },

services/harmony/test/workflow-ui/work-items-table-row.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const step2 = buildWorkflowStep(
3737
// build the items
3838
// give them an id so we know what id to request in the tests
3939
const item1 = buildWorkItem(
40-
{ jobID: targetJob.jobID, workflowStepIndex: 1, serviceID: step1ServiceId, status: WorkItemStatus.RUNNING, id: 1 },
40+
{ jobID: targetJob.jobID, workflowStepIndex: 1, serviceID: step1ServiceId, status: WorkItemStatus.RUNNING, id: 1, message_category: 'smoothly' },
4141
);
4242
const item2 = buildWorkItem(
4343
{ jobID: targetJob.jobID, workflowStepIndex: 1, serviceID: step1ServiceId, status: WorkItemStatus.SUCCESSFUL, id: 2 },
@@ -190,6 +190,10 @@ describe('Workflow UI work items table row route', function () {
190190
const listing = this.res.text;
191191
expect((listing.match(/retry-button/g) || []).length).to.equal(1);
192192
});
193+
it('returns the message_category along with the main status', async function () {
194+
const listing = this.res.text;
195+
expect(listing).to.contain(`<span class="badge rounded-pill bg-info">${WorkItemStatus.RUNNING.valueOf()}: smoothly</span>`);
196+
});
193197
});
194198

195199
describe('who requests a queued work item for their job', function () {
@@ -288,7 +292,7 @@ describe('Workflow UI work items table row route', function () {
288292
expect(listing).to.not.contain(`<span class="badge rounded-pill bg-success">${WorkItemStatus.SUCCESSFUL.valueOf()}</span>`);
289293
expect(listing).to.not.contain(`<span class="badge rounded-pill bg-secondary">${WorkItemStatus.CANCELED.valueOf()}</span>`);
290294
expect(listing).to.not.contain(`<span class="badge rounded-pill bg-primary">${WorkItemStatus.READY.valueOf()}</span>`);
291-
expect(listing).to.contain(`<span class="badge rounded-pill bg-info">${WorkItemStatus.RUNNING.valueOf()}</span>`);
295+
expect(listing).to.contain(`<span class="badge rounded-pill bg-info">${WorkItemStatus.RUNNING.valueOf()}: smoothly</span>`);
292296
});
293297
});
294298
});

0 commit comments

Comments
 (0)