Commit 3d6a8d0d authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch '327633-Time-label-is-misleading-on-the-job-details-page' into 'master'

Change job duration label to 'Elapsed time' when in progress

See merge request gitlab-org/gitlab!75811
parents 4566c0cb 0ca055cc
...@@ -20,6 +20,9 @@ export default { ...@@ -20,6 +20,9 @@ export default {
duration() { duration() {
return timeIntervalInWords(this.job.duration); return timeIntervalInWords(this.job.duration);
}, },
durationTitle() {
return this.job.finished_at ? __('Duration') : __('Elapsed time');
},
erasedAt() { erasedAt() {
return this.timeFormatted(this.job.erased_at); return this.timeFormatted(this.job.erased_at);
}, },
...@@ -76,7 +79,7 @@ export default { ...@@ -76,7 +79,7 @@ export default {
<template> <template>
<div v-if="shouldRenderBlock"> <div v-if="shouldRenderBlock">
<detail-row v-if="job.duration" :value="duration" title="Duration" /> <detail-row v-if="job.duration" :value="duration" :title="durationTitle" />
<detail-row <detail-row
v-if="job.finished_at" v-if="job.finished_at"
:value="finishedAt" :value="finishedAt"
......
...@@ -56,7 +56,7 @@ describe('Job Sidebar Details Container', () => { ...@@ -56,7 +56,7 @@ describe('Job Sidebar Details Container', () => {
beforeEach(createWrapper); beforeEach(createWrapper);
it.each([ it.each([
['duration', 'Duration: 6 seconds'], ['duration', 'Elapsed time: 6 seconds'],
['erased_at', 'Erased: 3 weeks ago'], ['erased_at', 'Erased: 3 weeks ago'],
['finished_at', 'Finished: 3 weeks ago'], ['finished_at', 'Finished: 3 weeks ago'],
['queued', 'Queued: 9 seconds'], ['queued', 'Queued: 9 seconds'],
...@@ -86,6 +86,15 @@ describe('Job Sidebar Details Container', () => { ...@@ -86,6 +86,15 @@ describe('Job Sidebar Details Container', () => {
expect(findAllDetailsRow()).toHaveLength(7); expect(findAllDetailsRow()).toHaveLength(7);
}); });
describe('duration row', () => {
it('renders all the details components', async () => {
createWrapper();
await store.dispatch('receiveJobSuccess', job);
expect(findAllDetailsRow().at(0).text()).toBe('Duration: 6 seconds');
});
});
}); });
describe('timeout', () => { describe('timeout', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment