Use `started` key to show the triggered date
This commit is contained in:
parent
17e30a3212
commit
7519a25a61
|
|
@ -42,6 +42,9 @@ export default {
|
|||
jobStarted() {
|
||||
return !this.job.started === false;
|
||||
},
|
||||
headerTime() {
|
||||
return this.jobStarted ? this.job.started : this.job.created_at;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
job() {
|
||||
|
|
@ -73,7 +76,7 @@ export default {
|
|||
:status="status"
|
||||
item-name="Job"
|
||||
:item-id="job.id"
|
||||
:time="job.created_at"
|
||||
:time="headerTime"
|
||||
:user="job.user"
|
||||
:actions="actions"
|
||||
:has-sidebar-button="true"
|
||||
|
|
|
|||
|
|
@ -13,6 +13,9 @@ describe('Job details header', () => {
|
|||
const threeWeeksAgo = new Date();
|
||||
threeWeeksAgo.setDate(threeWeeksAgo.getDate() - 21);
|
||||
|
||||
const twoDaysAgo = new Date();
|
||||
twoDaysAgo.setDate(twoDaysAgo.getDate() - 2);
|
||||
|
||||
props = {
|
||||
job: {
|
||||
status: {
|
||||
|
|
@ -31,7 +34,7 @@ describe('Job details header', () => {
|
|||
email: 'foo@bar.com',
|
||||
avatar_url: 'link',
|
||||
},
|
||||
started: '2018-01-08T09:48:27.319Z',
|
||||
started: twoDaysAgo.toISOString(),
|
||||
new_issue_path: 'path',
|
||||
},
|
||||
isLoading: false,
|
||||
|
|
@ -69,7 +72,7 @@ describe('Job details header', () => {
|
|||
.querySelector('.header-main-content')
|
||||
.textContent.replace(/\s+/g, ' ')
|
||||
.trim(),
|
||||
).toEqual('failed Job #123 triggered 3 weeks ago by Foo');
|
||||
).toEqual('failed Job #123 triggered 2 days ago by Foo');
|
||||
});
|
||||
|
||||
it('should render new issue link', () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue