Commit 1103f589 authored by Tim Zallmann's avatar Tim Zallmann

Merge branch '52614-update-job-started-check' into 'master'

Updates the check for started in job header

See merge request gitlab-org/gitlab-ce!22329
parents 7e342757 85c30d74
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
'headerActions', 'headerActions',
'headerTime', 'headerTime',
'shouldRenderCalloutMessage', 'shouldRenderCalloutMessage',
'jobHasStarted', 'shouldRenderTriggeredLabel',
'hasEnvironment', 'hasEnvironment',
'isJobStuck', 'isJobStuck',
'hasTrace', 'hasTrace',
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
:user="job.user" :user="job.user"
:actions="headerActions" :actions="headerActions"
:has-sidebar-button="true" :has-sidebar-button="true"
:should-render-triggered-label="jobHasStarted" :should-render-triggered-label="shouldRenderTriggeredLabel"
:item-name="__('Job')" :item-name="__('Job')"
/> />
</div> </div>
......
...@@ -22,10 +22,10 @@ export const shouldRenderCalloutMessage = state => ...@@ -22,10 +22,10 @@ export const shouldRenderCalloutMessage = state =>
!_.isEmpty(state.job.status) && !_.isEmpty(state.job.callout_message); !_.isEmpty(state.job.status) && !_.isEmpty(state.job.callout_message);
/** /**
* When job has not started the key will be `false` * When job has not started the key will be null
* When job started the key will be a string with a date. * When job started the key will be a string with a date.
*/ */
export const jobHasStarted = state => !(state.job.started === false); export const shouldRenderTriggeredLabel = state => _.isString(state.job.started);
export const hasEnvironment = state => !_.isEmpty(state.job.deployment_status); export const hasEnvironment = state => !_.isEmpty(state.job.deployment_status);
......
---
title: Fixes triggered/created labeled in job header
merge_request:
author:
type: fixed
...@@ -77,18 +77,18 @@ describe('Job Store Getters', () => { ...@@ -77,18 +77,18 @@ describe('Job Store Getters', () => {
}); });
}); });
describe('jobHasStarted', () => { describe('shouldRenderTriggeredLabel', () => {
describe('when started equals false', () => { describe('when started equals null', () => {
it('returns false', () => { it('returns false', () => {
localState.job.started = false; localState.job.started = null;
expect(getters.jobHasStarted(localState)).toEqual(false); expect(getters.shouldRenderTriggeredLabel(localState)).toEqual(false);
}); });
}); });
describe('when started equals string', () => { describe('when started equals string', () => {
it('returns true', () => { it('returns true', () => {
localState.job.started = '2018-08-31T16:20:49.023Z'; localState.job.started = '2018-08-31T16:20:49.023Z';
expect(getters.jobHasStarted(localState)).toEqual(true); expect(getters.shouldRenderTriggeredLabel(localState)).toEqual(true);
}); });
}); });
}); });
......
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