BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
dddd261c
Unverified
Commit
dddd261c
authored
Jan 11, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix boolean prop being provided as string
parent
34760245
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
9 deletions
+31
-9
header.vue
app/assets/javascripts/jobs/components/header.vue
+5
-1
header_spec.js
spec/javascripts/jobs/header_spec.js
+26
-8
No files found.
app/assets/javascripts/jobs/components/header.vue
View file @
dddd261c
...
@@ -30,8 +30,12 @@
...
@@ -30,8 +30,12 @@
shouldRenderContent
()
{
shouldRenderContent
()
{
return
!
this
.
isLoading
&&
Object
.
keys
(
this
.
job
).
length
;
return
!
this
.
isLoading
&&
Object
.
keys
(
this
.
job
).
length
;
},
},
/**
* When job has not started the key will be `false`
* When job started the key will be a string with a date.
*/
jobStarted
()
{
jobStarted
()
{
return
this
.
job
.
started
;
return
!
this
.
job
.
started
===
false
;
},
},
},
},
watch
:
{
watch
:
{
...
...
spec/javascripts/jobs/header_spec.js
View file @
dddd261c
...
@@ -31,6 +31,7 @@ describe('Job details header', () => {
...
@@ -31,6 +31,7 @@ describe('Job details header', () => {
email
:
'foo@bar.com'
,
email
:
'foo@bar.com'
,
avatar_url
:
'link'
,
avatar_url
:
'link'
,
},
},
started
:
'2018-01-08T09:48:27.319Z'
,
new_issue_path
:
'path'
,
new_issue_path
:
'path'
,
},
},
isLoading
:
false
,
isLoading
:
false
,
...
@@ -43,15 +44,32 @@ describe('Job details header', () => {
...
@@ -43,15 +44,32 @@ describe('Job details header', () => {
vm
.
$destroy
();
vm
.
$destroy
();
});
});
it
(
'should render provided job information'
,
()
=>
{
describe
(
'triggered job'
,
()
=>
{
expect
(
beforeEach
(()
=>
{
vm
.
$el
.
querySelector
(
'.header-main-content'
).
textContent
.
replace
(
/
\s
+/g
,
' '
).
trim
(),
vm
=
mountComponent
(
HeaderComponent
,
props
);
).
toEqual
(
'failed Job #123 triggered 3 weeks ago by Foo'
);
});
it
(
'should render provided job information'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'.header-main-content'
).
textContent
.
replace
(
/
\s
+/g
,
' '
).
trim
(),
).
toEqual
(
'failed Job #123 triggered 3 weeks ago by Foo'
);
});
it
(
'should render new issue link'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'.js-new-issue'
).
getAttribute
(
'href'
),
).
toEqual
(
props
.
job
.
new_issue_path
);
});
});
});
it
(
'should render new issue link'
,
()
=>
{
describe
(
'created job'
,
()
=>
{
expect
(
it
(
'should render created key'
,
()
=>
{
vm
.
$el
.
querySelector
(
'.js-new-issue'
).
getAttribute
(
'href'
),
props
.
job
.
started
=
false
;
).
toEqual
(
props
.
job
.
new_issue_path
);
vm
=
mountComponent
(
HeaderComponent
,
props
);
expect
(
vm
.
$el
.
querySelector
(
'.header-main-content'
).
textContent
.
replace
(
/
\s
+/g
,
' '
).
trim
(),
).
toEqual
(
'failed Job #123 created 3 weeks ago by Foo'
);
});
});
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment