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
68634383
Unverified
Commit
68634383
authored
Mar 14, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed useless v-if
removed pointless test & changed some deployment tests to make more sense added in v-tooltip
parent
123614fa
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
55 deletions
+17
-55
deployment.vue
...cripts/vue_merge_request_widget/components/deployment.vue
+3
-4
mr_widget_options.js
...javascripts/vue_merge_request_widget/mr_widget_options.js
+0
-4
merge_requests.scss
app/assets/stylesheets/pages/merge_requests.scss
+0
-4
deployment_spec.js
spec/javascripts/vue_mr_widget/components/deployment_spec.js
+14
-4
mr_widget_options_spec.js
spec/javascripts/vue_mr_widget/mr_widget_options_spec.js
+0
-39
No files found.
app/assets/javascripts/vue_merge_request_widget/components/deployment.vue
View file @
68634383
...
...
@@ -119,16 +119,15 @@ export default {
</
template
>
<span
v-if=
"hasDeploymentTime"
:data-title=
"deployment.deployed_at_formatted"
v-tooltip
:title=
"deployment.deployed_at_formatted"
class=
"js-deploy-time"
data-toggle=
"tooltip"
data-placement=
"top"
>
{{ deployTimeago }}
</span>
<loading-button
v-if=
"deployment.stop_url"
container-class=
"btn btn-default btn-xs"
container-class=
"btn btn-default btn-xs
prepend-left-default
"
label=
"Stop environment"
:loading=
"isStopping"
@
click=
"stopEnvironment"
...
...
app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js
View file @
68634383
...
...
@@ -67,9 +67,6 @@ export default {
shouldRenderRelatedLinks
()
{
return
!!
this
.
mr
.
relatedLinks
&&
!
this
.
mr
.
isNothingToMergeState
;
},
shouldRenderDeployments
()
{
return
this
.
mr
.
deployments
.
length
;
},
shouldRenderSourceBranchRemovalStatus
()
{
return
!
this
.
mr
.
canRemoveSourceBranch
&&
this
.
mr
.
shouldRemoveSourceBranch
&&
(
!
this
.
mr
.
isNothingToMergeState
&&
!
this
.
mr
.
isMergedState
);
...
...
@@ -251,7 +248,6 @@ export default {
:has-ci="mr.hasCI"
/>
<deployment
v-if="shouldRenderDeployments"
v-for="deployment in mr.deployments"
:key="deployment.id"
:deployment="deployment"
...
...
app/assets/stylesheets/pages/merge_requests.scss
View file @
68634383
...
...
@@ -748,10 +748,6 @@
>
*
:not
(
:last-child
)
{
margin-right
:
.3em
;
}
.btn
{
margin-left
:
$gl-padding
;
}
}
.deploy-link
{
...
...
spec/javascripts/vue_mr_widget/components/deployment_spec.js
View file @
68634383
...
...
@@ -147,16 +147,26 @@ describe('Deployment component', () => {
el
=
vm
.
$el
;
});
it
(
'should render template elements correctly'
,
()
=>
{
expect
(
el
.
classList
.
contains
(
'mr-widget-heading'
)).
toEqual
(
true
);
expect
(
el
.
querySelector
(
'.js-icon-link'
)).
not
.
toBeNull
();
it
(
'renders deployment name'
,
()
=>
{
expect
(
el
.
querySelector
(
'.js-deploy-meta'
).
getAttribute
(
'href'
)).
toEqual
(
deploymentMockData
.
url
);
expect
(
el
.
querySelector
(
'.js-deploy-meta'
).
innerText
).
toContain
(
deploymentMockData
.
name
);
});
it
(
'renders external URL'
,
()
=>
{
expect
(
el
.
querySelector
(
'.js-deploy-url'
).
getAttribute
(
'href'
)).
toEqual
(
deploymentMockData
.
external_url
);
expect
(
el
.
querySelector
(
'.js-deploy-url'
).
innerText
).
toContain
(
deploymentMockData
.
external_url_formatted
);
});
it
(
'renders stop button'
,
()
=>
{
expect
(
el
.
querySelector
(
'.btn'
)).
not
.
toBeNull
();
});
it
(
'renders deployment time'
,
()
=>
{
expect
(
el
.
querySelector
(
'.js-deploy-time'
).
innerText
).
toContain
(
vm
.
deployTimeago
);
});
it
(
'renders metrics component'
,
()
=>
{
expect
(
el
.
querySelector
(
'.js-mr-memory-usage'
)).
not
.
toBeNull
();
expect
(
el
.
querySelector
(
'button'
)).
not
.
toBeNull
();
});
});
});
spec/javascripts/vue_mr_widget/mr_widget_options_spec.js
View file @
68634383
...
...
@@ -123,17 +123,6 @@ describe('mrWidgetOptions', () => {
expect
(
vm
.
shouldRenderSourceBranchRemovalStatus
).
toEqual
(
false
);
});
});
describe
(
'shouldRenderDeployments'
,
()
=>
{
it
(
'should return false for the initial data'
,
()
=>
{
expect
(
vm
.
shouldRenderDeployments
).
toBeFalsy
();
});
it
(
'should return true if there is deployments'
,
()
=>
{
vm
.
mr
.
deployments
.
push
({},
{});
expect
(
vm
.
shouldRenderDeployments
).
toBeTruthy
();
});
});
});
describe
(
'methods'
,
()
=>
{
...
...
@@ -368,34 +357,6 @@ describe('mrWidgetOptions', () => {
});
});
describe
(
'components'
,
()
=>
{
it
(
'should register all components'
,
()
=>
{
const
comps
=
mrWidgetOptions
.
components
;
expect
(
comps
[
'mr-widget-header'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-merge-help'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-pipeline'
]).
toBeDefined
();
expect
(
comps
.
Deployment
).
toBeDefined
();
expect
(
comps
[
'mr-widget-related-links'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-merged'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-closed'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-merging'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-failed-to-merge'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-wip'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-archived'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-conflicts'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-nothing-to-merge'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-not-allowed'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-missing-branch'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-ready-to-merge'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-checking'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-unresolved-discussions'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-pipeline-blocked'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-pipeline-failed'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-merge-when-pipeline-succeeds'
]).
toBeDefined
();
expect
(
comps
[
'mr-widget-maintainer-edit'
]).
toBeDefined
();
});
});
describe
(
'rendering relatedLinks'
,
()
=>
{
beforeEach
((
done
)
=>
{
vm
.
mr
.
relatedLinks
=
{
...
...
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