Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
90e0709d
Commit
90e0709d
authored
Sep 27, 2018
by
Filipa Lacerda
Committed by
Phil Hughes
Sep 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates Vue job components to match new API
parent
b42e7740
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
159 additions
and
166 deletions
+159
-166
app/assets/javascripts/jobs/components/empty_state.vue
app/assets/javascripts/jobs/components/empty_state.vue
+2
-2
app/assets/javascripts/jobs/components/erased_block.vue
app/assets/javascripts/jobs/components/erased_block.vue
+23
-26
app/assets/javascripts/jobs/components/job_log.vue
app/assets/javascripts/jobs/components/job_log.vue
+2
-2
app/assets/javascripts/jobs/components/job_log_controllers.vue
...ssets/javascripts/jobs/components/job_log_controllers.vue
+43
-33
app/assets/javascripts/jobs/components/stuck_block.vue
app/assets/javascripts/jobs/components/stuck_block.vue
+3
-3
locale/gitlab.pot
locale/gitlab.pot
+0
-3
spec/javascripts/jobs/components/empty_state_spec.js
spec/javascripts/jobs/components/empty_state_spec.js
+1
-1
spec/javascripts/jobs/components/erased_block_spec.js
spec/javascripts/jobs/components/erased_block_spec.js
+4
-4
spec/javascripts/jobs/components/job_log_controllers_spec.js
spec/javascripts/jobs/components/job_log_controllers_spec.js
+78
-89
spec/javascripts/jobs/components/job_log_spec.js
spec/javascripts/jobs/components/job_log_spec.js
+3
-3
No files found.
app/assets/javascripts/jobs/components/empty_state.vue
View file @
90e0709d
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
validator
(
value
)
{
validator
(
value
)
{
return
(
return
(
value
===
null
||
value
===
null
||
(
Object
.
prototype
.
hasOwnProperty
.
call
(
value
,
'
link
'
)
&&
(
Object
.
prototype
.
hasOwnProperty
.
call
(
value
,
'
path
'
)
&&
Object
.
prototype
.
hasOwnProperty
.
call
(
value
,
'
method
'
)
&&
Object
.
prototype
.
hasOwnProperty
.
call
(
value
,
'
method
'
)
&&
Object
.
prototype
.
hasOwnProperty
.
call
(
value
,
'
title
'
))
Object
.
prototype
.
hasOwnProperty
.
call
(
value
,
'
title
'
))
);
);
...
@@ -63,7 +63,7 @@
...
@@ -63,7 +63,7 @@
class=
"text-center"
class=
"text-center"
>
>
<a
<a
:href=
"action.
link
"
:href=
"action.
path
"
:data-method=
"action.method"
:data-method=
"action.method"
class=
"js-job-empty-state-action btn btn-primary"
class=
"js-job-empty-state-action btn btn-primary"
>
>
...
...
app/assets/javascripts/jobs/components/erased_block.vue
View file @
90e0709d
<
script
>
<
script
>
import
TimeagoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
_
from
'
underscore
'
;
import
TimeagoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
export
default
{
export
default
{
components
:
{
components
:
{
TimeagoTooltip
,
TimeagoTooltip
,
},
},
props
:
{
props
:
{
erasedByUser
:
{
user
:
{
type
:
Boolean
,
type
:
Object
,
required
:
true
,
},
username
:
{
type
:
String
,
required
:
false
,
default
:
null
,
},
linkToUser
:
{
type
:
String
,
required
:
false
,
required
:
false
,
default
:
null
,
default
:
()
=>
({})
,
},
},
erasedAt
:
{
erasedAt
:
{
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
},
},
},
};
computed
:
{
isErasedByUser
()
{
return
!
_
.
isEmpty
(
this
.
user
);
},
},
};
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"prepend-top-default js-build-erased"
>
<div
class=
"prepend-top-default js-build-erased"
>
<div
class=
"erased alert alert-warning"
>
<div
class=
"erased alert alert-warning"
>
<template
v-if=
"
e
rasedByUser"
>
<template
v-if=
"
isE
rasedByUser"
>
{{
s__
(
"
Job|Job has been erased by
"
)
}}
{{
s__
(
"
Job|Job has been erased by
"
)
}}
<a
:href=
"
linkToUser
"
>
<a
:href=
"
user.web_url
"
>
{{
username
}}
{{
user
.
user
name
}}
</a>
</a>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
...
...
app/assets/javascripts/jobs/components/job_log.vue
View file @
90e0709d
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
},
is
ReceivingBuildTrac
e
:
{
is
Complet
e
:
{
type
:
Boolean
,
type
:
Boolean
,
required
:
true
,
required
:
true
,
},
},
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
</code>
</code>
<div
<div
v-if=
"is
ReceivingBuildTrac
e"
v-if=
"is
Complet
e"
class=
"js-log-animation build-loader-animation"
class=
"js-log-animation build-loader-animation"
>
>
<div
class=
"dot"
></div>
<div
class=
"dot"
></div>
...
...
app/assets/javascripts/jobs/components/job_log_controllers.vue
View file @
90e0709d
<
script
>
<
script
>
import
{
polyfillSticky
}
from
'
~/lib/utils/sticky
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
{
numberToHumanSize
}
from
'
~/lib/utils/number_utils
'
;
import
{
numberToHumanSize
}
from
'
~/lib/utils/number_utils
'
;
import
{
s
__
,
s
printf
}
from
'
~/locale
'
;
import
{
sprintf
}
from
'
~/locale
'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -12,44 +13,48 @@
...
@@ -12,44 +13,48 @@
tooltip
,
tooltip
,
},
},
props
:
{
props
:
{
canEraseJob
:
{
erasePath
:
{
type
:
Boolean
,
type
:
String
,
required
:
true
,
required
:
false
,
default
:
null
,
},
},
size
:
{
size
:
{
type
:
Number
,
type
:
Number
,
required
:
true
,
required
:
true
,
},
},
raw
Trace
Path
:
{
rawPath
:
{
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
default
:
null
,
default
:
null
,
},
},
canScrollToTop
:
{
isScrollTopDisabled
:
{
type
:
Boolean
,
type
:
Boolean
,
required
:
true
,
required
:
true
,
},
},
canScrollToBottom
:
{
isScrollBottomDisabled
:
{
type
:
Boolean
,
required
:
true
,
},
isScrollingDown
:
{
type
:
Boolean
,
required
:
true
,
},
isTraceSizeVisible
:
{
type
:
Boolean
,
type
:
Boolean
,
required
:
true
,
required
:
true
,
},
},
},
},
computed
:
{
computed
:
{
jobLogSize
()
{
jobLogSize
()
{
return
sprintf
(
'
Showing last %{startSpanTag} %{size} %{endSpanTag} of log -
'
,
{
return
sprintf
(
'
Showing last %{size} of log -
'
,
{
startSpanTag
:
'
<span class="s-truncated-info-size truncated-info-size">
'
,
endSpanTag
:
'
</span>
'
,
size
:
numberToHumanSize
(
this
.
size
),
size
:
numberToHumanSize
(
this
.
size
),
});
});
},
},
},
},
methods
:
{
mounted
()
{
handleEraseJobClick
()
{
polyfillSticky
(
this
.
$el
);
// eslint-disable-next-line no-alert
if
(
window
.
confirm
(
s__
(
'
Job|Are you sure you want to erase this job?
'
)))
{
this
.
$emit
(
'
eraseJob
'
);
}
},
},
methods
:
{
handleScrollToTop
()
{
handleScrollToTop
()
{
this
.
$emit
(
'
scrollJobLogTop
'
);
this
.
$emit
(
'
scrollJobLogTop
'
);
},
},
...
@@ -57,48 +62,52 @@
...
@@ -57,48 +62,52 @@
this
.
$emit
(
'
scrollJobLogBottom
'
);
this
.
$emit
(
'
scrollJobLogBottom
'
);
},
},
},
},
};
};
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"top-bar"
>
<div
class=
"top-bar"
>
<!-- truncate information -->
<!-- truncate information -->
<div
class=
"js-truncated-info truncated-info d-none d-sm-block float-left"
>
<div
class=
"js-truncated-info truncated-info d-none d-sm-block float-left"
>
<p
v-html=
"jobLogSize"
></p>
<template
v-if=
"isTraceSizeVisible"
>
{{
jobLogSize
}}
<a
<a
v-if=
"rawTrace
Path"
v-if=
"raw
Path"
:href=
"rawTrace
Path"
:href=
"raw
Path"
class=
"js-raw-link raw-link"
class=
"js-raw-link raw-link"
>
>
{{
s__
(
"
Job|Complete Raw
"
)
}}
{{
s__
(
"
Job|Complete Raw
"
)
}}
</a>
</a>
</
template
>
</div>
</div>
<!-- eo truncate information -->
<!-- eo truncate information -->
<div
class=
"controllers float-right"
>
<div
class=
"controllers float-right"
>
<!-- links -->
<!-- links -->
<a
<a
v-if=
"raw
Trace
Path"
v-if=
"rawPath"
v-tooltip
v-tooltip
:title=
"s__('Job|Show complete raw')"
:title=
"s__('Job|Show complete raw')"
:href=
"raw
Trace
Path"
:href=
"rawPath"
class=
"js-raw-link-controller controllers-buttons"
class=
"js-raw-link-controller controllers-buttons"
data-container=
"body"
data-container=
"body"
>
>
<icon
name=
"doc-text"
/>
<icon
name=
"doc-text"
/>
</a>
</a>
<
button
<
a
v-if=
"
canEraseJob
"
v-if=
"
erasePath
"
v-tooltip
v-tooltip
:title=
"s__('Job|Erase job log')"
:title=
"s__('Job|Erase job log')"
type=
"button"
:href=
"erasePath"
data-confirm=
"__('Are you sure you want to erase this build?')"
class=
"js-erase-link controllers-buttons"
class=
"js-erase-link controllers-buttons"
data-container=
"body"
data-container=
"body"
@
click=
"handleEraseJobClick
"
data-method=
"post
"
>
>
<icon
name=
"remove"
/>
<icon
name=
"remove"
/>
</
button
>
</
a
>
<!-- eo links -->
<!-- eo links -->
<!-- scroll buttons -->
<!-- scroll buttons -->
...
@@ -109,7 +118,7 @@
...
@@ -109,7 +118,7 @@
data-container=
"body"
data-container=
"body"
>
>
<button
<button
:disabled=
"
!canScrollToTop
"
:disabled=
"
isScrollTopDisabled
"
type=
"button"
type=
"button"
class=
"js-scroll-top btn-scroll btn-transparent btn-blank"
class=
"js-scroll-top btn-scroll btn-transparent btn-blank"
@
click=
"handleScrollToTop"
@
click=
"handleScrollToTop"
...
@@ -125,9 +134,10 @@
...
@@ -125,9 +134,10 @@
data-container=
"body"
data-container=
"body"
>
>
<button
<button
:disabled=
"
!canScrollToBottom
"
:disabled=
"
isScrollBottomDisabled
"
type=
"button"
type=
"button"
class=
"js-scroll-bottom btn-scroll btn-transparent btn-blank"
class=
"js-scroll-bottom btn-scroll btn-transparent btn-blank"
:class=
"{ animate: isScrollingDown }"
@
click=
"handleScrollToBottom"
@
click=
"handleScrollToBottom"
>
>
<icon
name=
"scroll_down"
/>
<icon
name=
"scroll_down"
/>
...
...
app/assets/javascripts/jobs/components/stuck_block.vue
View file @
90e0709d
...
@@ -24,14 +24,14 @@ export default {
...
@@ -24,14 +24,14 @@ export default {
<div
class=
"bs-callout bs-callout-warning"
>
<div
class=
"bs-callout bs-callout-warning"
>
<p
<p
v-if=
"hasNoRunnersForProject"
v-if=
"hasNoRunnersForProject"
class=
"js-stuck-no-runners"
class=
"js-stuck-no-runners
append-bottom-0
"
>
>
{{
s__
(
`Job|This job is stuck, because the project
{{
s__
(
`Job|This job is stuck, because the project
doesn't have any runners online assigned to it.`
)
}}
doesn't have any runners online assigned to it.`
)
}}
</p>
</p>
<p
<p
v-else-if=
"tags.length"
v-else-if=
"tags.length"
class=
"js-stuck-with-tags"
class=
"js-stuck-with-tags
append-bottom-0
"
>
>
{{
s__
(
`This job is stuck, because you don't have
{{
s__
(
`This job is stuck, because you don't have
any active runners online with any of these tags assigned to them:`
)
}}
any active runners online with any of these tags assigned to them:`
)
}}
...
@@ -45,7 +45,7 @@ export default {
...
@@ -45,7 +45,7 @@ export default {
</p>
</p>
<p
<p
v-else
v-else
class=
"js-stuck-no-active-runner"
class=
"js-stuck-no-active-runner
append-bottom-0
"
>
>
{{
s__
(
`This job is stuck, because you don't
{{
s__
(
`This job is stuck, because you don't
have any active runners that can run this job.`
)
}}
have any active runners that can run this job.`
)
}}
...
...
locale/gitlab.pot
View file @
90e0709d
...
@@ -3338,9 +3338,6 @@ msgstr ""
...
@@ -3338,9 +3338,6 @@ msgstr ""
msgid "Jobs"
msgid "Jobs"
msgstr ""
msgstr ""
msgid "Job|Are you sure you want to erase this job?"
msgstr ""
msgid "Job|Browse"
msgid "Job|Browse"
msgstr ""
msgstr ""
...
...
spec/javascripts/jobs/components/empty_state_spec.js
View file @
90e0709d
...
@@ -66,7 +66,7 @@ describe('Empty State', () => {
...
@@ -66,7 +66,7 @@ describe('Empty State', () => {
...
props
,
...
props
,
content
,
content
,
action
:
{
action
:
{
link
:
'
runner
'
,
path
:
'
runner
'
,
title
:
'
Check runner
'
,
title
:
'
Check runner
'
,
method
:
'
post
'
,
method
:
'
post
'
,
},
},
...
...
spec/javascripts/jobs/components/erased_block_spec.js
View file @
90e0709d
...
@@ -18,9 +18,10 @@ describe('Erased block', () => {
...
@@ -18,9 +18,10 @@ describe('Erased block', () => {
describe
(
'
with job erased by user
'
,
()
=>
{
describe
(
'
with job erased by user
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
vm
=
mountComponent
(
Component
,
{
erasedByUser
:
true
,
user
:
{
username
:
'
root
'
,
username
:
'
root
'
,
linkToUser
:
'
gitlab.com/root
'
,
web_url
:
'
gitlab.com/root
'
,
},
erasedAt
,
erasedAt
,
});
});
});
});
...
@@ -40,7 +41,6 @@ describe('Erased block', () => {
...
@@ -40,7 +41,6 @@ describe('Erased block', () => {
describe
(
'
with erased job
'
,
()
=>
{
describe
(
'
with erased job
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
vm
=
mountComponent
(
Component
,
{
erasedByUser
:
false
,
erasedAt
,
erasedAt
,
});
});
});
});
...
...
spec/javascripts/jobs/components/job_log_controllers_spec.js
View file @
90e0709d
...
@@ -10,18 +10,21 @@ describe('Job log controllers', () => {
...
@@ -10,18 +10,21 @@ describe('Job log controllers', () => {
vm
.
$destroy
();
vm
.
$destroy
();
});
});
describe
(
'
Truncate information
'
,
()
=>
{
const
props
=
{
rawPath
:
'
/raw
'
,
erasePath
:
'
/erase
'
,
size
:
511952
,
isScrollTopDisabled
:
false
,
isScrollBottomDisabled
:
false
,
isScrollingDown
:
true
,
isTraceSizeVisible
:
true
,
};
describe
(
'
Truncate information
'
,
()
=>
{
describe
(
'
with isTraceSizeVisible
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
vm
=
mountComponent
(
Component
,
props
);
rawTracePath
:
'
/raw
'
,
canEraseJob
:
true
,
size
:
511952
,
canScrollToTop
:
true
,
canScrollToBottom
:
true
,
});
});
});
it
(
'
renders size information
'
,
()
=>
{
it
(
'
renders size information
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-truncated-info
'
).
textContent
).
toContain
(
'
499.95 KiB
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-truncated-info
'
).
textContent
).
toContain
(
'
499.95 KiB
'
);
});
});
...
@@ -29,31 +32,29 @@ describe('Job log controllers', () => {
...
@@ -29,31 +32,29 @@ describe('Job log controllers', () => {
it
(
'
renders link to raw trace
'
,
()
=>
{
it
(
'
renders link to raw trace
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-raw-link
'
).
getAttribute
(
'
href
'
)).
toEqual
(
'
/raw
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-raw-link
'
).
getAttribute
(
'
href
'
)).
toEqual
(
'
/raw
'
);
});
});
});
});
});
describe
(
'
links section
'
,
()
=>
{
describe
(
'
links section
'
,
()
=>
{
describe
(
'
with raw trace path
'
,
()
=>
{
describe
(
'
with raw trace path
'
,
()
=>
{
it
(
'
renders raw trace link
'
,
()
=>
{
it
(
'
renders raw trace link
'
,
()
=>
{
vm
=
mountComponent
(
Component
,
{
vm
=
mountComponent
(
Component
,
props
);
rawTracePath
:
'
/raw
'
,
canEraseJob
:
true
,
size
:
511952
,
canScrollToTop
:
true
,
canScrollToBottom
:
true
,
});
expect
(
vm
.
$el
.
querySelector
(
'
.js-raw-link-controller
'
).
getAttribute
(
'
href
'
)).
toEqual
(
'
/raw
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-raw-link-controller
'
).
getAttribute
(
'
href
'
)).
toEqual
(
'
/raw
'
,
);
});
});
});
});
describe
(
'
without raw trace path
'
,
()
=>
{
describe
(
'
without raw trace path
'
,
()
=>
{
it
(
'
does not render raw trace link
'
,
()
=>
{
it
(
'
does not render raw trace link
'
,
()
=>
{
vm
=
mountComponent
(
Component
,
{
vm
=
mountComponent
(
Component
,
{
canEraseJob
:
true
,
erasePath
:
'
/erase
'
,
size
:
511952
,
size
:
511952
,
canScrollToTop
:
true
,
isScrollTopDisabled
:
true
,
canScrollToBottom
:
true
,
isScrollBottomDisabled
:
true
,
isScrollingDown
:
false
,
isTraceSizeVisible
:
true
,
});
});
expect
(
vm
.
$el
.
querySelector
(
'
.js-raw-link-controller
'
)).
toBeNull
();
expect
(
vm
.
$el
.
querySelector
(
'
.js-raw-link-controller
'
)).
toBeNull
();
...
@@ -62,52 +63,23 @@ describe('Job log controllers', () => {
...
@@ -62,52 +63,23 @@ describe('Job log controllers', () => {
describe
(
'
when is erasable
'
,
()
=>
{
describe
(
'
when is erasable
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
vm
=
mountComponent
(
Component
,
props
);
rawTracePath
:
'
/raw
'
,
canEraseJob
:
true
,
size
:
511952
,
canScrollToTop
:
true
,
canScrollToBottom
:
true
,
});
});
});
it
(
'
renders erase job
button
'
,
()
=>
{
it
(
'
renders erase job
link
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-erase-link
'
)).
not
.
toBeNull
();
expect
(
vm
.
$el
.
querySelector
(
'
.js-erase-link
'
)).
not
.
toBeNull
();
});
});
describe
(
'
on click
'
,
()
=>
{
describe
(
'
when user confirms action
'
,
()
=>
{
it
(
'
emits eraseJob event
'
,
()
=>
{
spyOn
(
window
,
'
confirm
'
).
and
.
returnValue
(
true
);
spyOn
(
vm
,
'
$emit
'
);
vm
.
$el
.
querySelector
(
'
.js-erase-link
'
).
click
();
expect
(
vm
.
$emit
).
toHaveBeenCalledWith
(
'
eraseJob
'
);
});
});
describe
(
'
when user does not confirm action
'
,
()
=>
{
it
(
'
does not emit eraseJob event
'
,
()
=>
{
spyOn
(
window
,
'
confirm
'
).
and
.
returnValue
(
false
);
spyOn
(
vm
,
'
$emit
'
);
vm
.
$el
.
querySelector
(
'
.js-erase-link
'
).
click
();
expect
(
vm
.
$emit
).
not
.
toHaveBeenCalledWith
(
'
eraseJob
'
);
});
});
});
});
});
describe
(
'
when it is not erasable
'
,
()
=>
{
describe
(
'
when it is not erasable
'
,
()
=>
{
it
(
'
does not render erase button
'
,
()
=>
{
it
(
'
does not render erase button
'
,
()
=>
{
vm
=
mountComponent
(
Component
,
{
vm
=
mountComponent
(
Component
,
{
rawTracePath
:
'
/raw
'
,
rawPath
:
'
/raw
'
,
canEraseJob
:
false
,
size
:
511952
,
size
:
511952
,
canScrollToTop
:
true
,
isScrollTopDisabled
:
true
,
canScrollToBottom
:
true
,
isScrollBottomDisabled
:
true
,
isScrollingDown
:
false
,
isTraceSizeVisible
:
true
,
});
});
expect
(
vm
.
$el
.
querySelector
(
'
.js-erase-link
'
)).
toBeNull
();
expect
(
vm
.
$el
.
querySelector
(
'
.js-erase-link
'
)).
toBeNull
();
...
@@ -119,13 +91,7 @@ describe('Job log controllers', () => {
...
@@ -119,13 +91,7 @@ describe('Job log controllers', () => {
describe
(
'
scroll top button
'
,
()
=>
{
describe
(
'
scroll top button
'
,
()
=>
{
describe
(
'
when user can scroll top
'
,
()
=>
{
describe
(
'
when user can scroll top
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
vm
=
mountComponent
(
Component
,
props
);
rawTracePath
:
'
/raw
'
,
canEraseJob
:
true
,
size
:
511952
,
canScrollToTop
:
true
,
canScrollToBottom
:
true
,
});
});
});
it
(
'
renders enabled scroll top button
'
,
()
=>
{
it
(
'
renders enabled scroll top button
'
,
()
=>
{
...
@@ -143,16 +109,20 @@ describe('Job log controllers', () => {
...
@@ -143,16 +109,20 @@ describe('Job log controllers', () => {
describe
(
'
when user can not scroll top
'
,
()
=>
{
describe
(
'
when user can not scroll top
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
vm
=
mountComponent
(
Component
,
{
raw
Trace
Path
:
'
/raw
'
,
rawPath
:
'
/raw
'
,
canEraseJob
:
true
,
erasePath
:
'
/erase
'
,
size
:
511952
,
size
:
511952
,
canScrollToTop
:
false
,
isScrollTopDisabled
:
true
,
canScrollToBottom
:
true
,
isScrollBottomDisabled
:
false
,
isScrollingDown
:
false
,
isTraceSizeVisible
:
true
,
});
});
});
});
it
(
'
renders disabled scroll top button
'
,
()
=>
{
it
(
'
renders disabled scroll top button
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-scroll-top
'
).
getAttribute
(
'
disabled
'
)).
toEqual
(
'
disabled
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-scroll-top
'
).
getAttribute
(
'
disabled
'
)).
toEqual
(
'
disabled
'
,
);
});
});
it
(
'
does not emit scrollJobLogTop event on click
'
,
()
=>
{
it
(
'
does not emit scrollJobLogTop event on click
'
,
()
=>
{
...
@@ -167,13 +137,7 @@ describe('Job log controllers', () => {
...
@@ -167,13 +137,7 @@ describe('Job log controllers', () => {
describe
(
'
scroll bottom button
'
,
()
=>
{
describe
(
'
scroll bottom button
'
,
()
=>
{
describe
(
'
when user can scroll bottom
'
,
()
=>
{
describe
(
'
when user can scroll bottom
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
vm
=
mountComponent
(
Component
,
props
);
rawTracePath
:
'
/raw
'
,
canEraseJob
:
true
,
size
:
511952
,
canScrollToTop
:
true
,
canScrollToBottom
:
true
,
});
});
});
it
(
'
renders enabled scroll bottom button
'
,
()
=>
{
it
(
'
renders enabled scroll bottom button
'
,
()
=>
{
...
@@ -191,17 +155,20 @@ describe('Job log controllers', () => {
...
@@ -191,17 +155,20 @@ describe('Job log controllers', () => {
describe
(
'
when user can not scroll bottom
'
,
()
=>
{
describe
(
'
when user can not scroll bottom
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
vm
=
mountComponent
(
Component
,
{
raw
Trace
Path
:
'
/raw
'
,
rawPath
:
'
/raw
'
,
canEraseJob
:
true
,
erasePath
:
'
/erase
'
,
size
:
511952
,
size
:
511952
,
canScrollToTop
:
true
,
isScrollTopDisabled
:
false
,
canScrollToBottom
:
false
,
isScrollBottomDisabled
:
true
,
isScrollingDown
:
false
,
isTraceSizeVisible
:
true
,
});
});
});
});
it
(
'
renders disabled scroll bottom button
'
,
()
=>
{
it
(
'
renders disabled scroll bottom button
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-scroll-bottom
'
).
getAttribute
(
'
disabled
'
)).
toEqual
(
'
disabled
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-scroll-bottom
'
).
getAttribute
(
'
disabled
'
)).
toEqual
(
'
disabled
'
,
);
});
});
it
(
'
does not emit scrollJobLogBottom event on click
'
,
()
=>
{
it
(
'
does not emit scrollJobLogBottom event on click
'
,
()
=>
{
...
@@ -211,7 +178,29 @@ describe('Job log controllers', () => {
...
@@ -211,7 +178,29 @@ describe('Job log controllers', () => {
expect
(
vm
.
$emit
).
not
.
toHaveBeenCalledWith
(
'
scrollJobLogBottom
'
);
expect
(
vm
.
$emit
).
not
.
toHaveBeenCalledWith
(
'
scrollJobLogBottom
'
);
});
});
});
});
describe
(
'
while isScrollingDown is true
'
,
()
=>
{
it
(
'
renders animate class for the scroll down button
'
,
()
=>
{
vm
=
mountComponent
(
Component
,
props
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-scroll-bottom
'
).
className
).
toContain
(
'
animate
'
);
});
});
});
});
});
describe
(
'
while isScrollingDown is false
'
,
()
=>
{
it
(
'
does not render animate class for the scroll down button
'
,
()
=>
{
vm
=
mountComponent
(
Component
,
{
rawPath
:
'
/raw
'
,
erasePath
:
'
/erase
'
,
size
:
511952
,
isScrollTopDisabled
:
true
,
isScrollBottomDisabled
:
false
,
isScrollingDown
:
false
,
isTraceSizeVisible
:
true
,
});
expect
(
vm
.
$el
.
querySelector
(
'
.js-scroll-bottom
'
).
className
).
not
.
toContain
(
'
animate
'
);
});
});
});
});
});
spec/javascripts/jobs/components/job_log_spec.js
View file @
90e0709d
...
@@ -15,7 +15,7 @@ describe('Job Log', () => {
...
@@ -15,7 +15,7 @@ describe('Job Log', () => {
it
(
'
renders provided trace
'
,
()
=>
{
it
(
'
renders provided trace
'
,
()
=>
{
vm
=
mountComponent
(
Component
,
{
vm
=
mountComponent
(
Component
,
{
trace
,
trace
,
is
ReceivingBuildTrac
e
:
true
,
is
Complet
e
:
true
,
});
});
expect
(
vm
.
$el
.
querySelector
(
'
code
'
).
textContent
).
toContain
(
'
Running with gitlab-runner 11.1.0 (081978aa)
'
);
expect
(
vm
.
$el
.
querySelector
(
'
code
'
).
textContent
).
toContain
(
'
Running with gitlab-runner 11.1.0 (081978aa)
'
);
...
@@ -25,7 +25,7 @@ describe('Job Log', () => {
...
@@ -25,7 +25,7 @@ describe('Job Log', () => {
it
(
'
renders animation
'
,
()
=>
{
it
(
'
renders animation
'
,
()
=>
{
vm
=
mountComponent
(
Component
,
{
vm
=
mountComponent
(
Component
,
{
trace
,
trace
,
is
ReceivingBuildTrac
e
:
true
,
is
Complet
e
:
true
,
});
});
expect
(
vm
.
$el
.
querySelector
(
'
.js-log-animation
'
)).
not
.
toBeNull
();
expect
(
vm
.
$el
.
querySelector
(
'
.js-log-animation
'
)).
not
.
toBeNull
();
...
@@ -36,7 +36,7 @@ describe('Job Log', () => {
...
@@ -36,7 +36,7 @@ describe('Job Log', () => {
it
(
'
does not render animation
'
,
()
=>
{
it
(
'
does not render animation
'
,
()
=>
{
vm
=
mountComponent
(
Component
,
{
vm
=
mountComponent
(
Component
,
{
trace
,
trace
,
is
ReceivingBuildTrac
e
:
false
,
is
Complet
e
:
false
,
});
});
expect
(
vm
.
$el
.
querySelector
(
'
.js-log-animation
'
)).
toBeNull
();
expect
(
vm
.
$el
.
querySelector
(
'
.js-log-animation
'
)).
toBeNull
();
...
...
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