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
81862c2d
Commit
81862c2d
authored
Nov 13, 2017
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport spec changes from EE remove approvals in empty state
See
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3376
parent
6ffb9ffd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
mr_widget_options.js
...javascripts/vue_merge_request_widget/mr_widget_options.js
+1
-1
mr_widget_options_spec.js
spec/javascripts/vue_mr_widget/mr_widget_options_spec.js
+10
-9
No files found.
app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js
View file @
81862c2d
...
...
@@ -61,7 +61,7 @@ export default {
return
this
.
mr
.
hasCI
;
},
shouldRenderRelatedLinks
()
{
return
this
.
mr
.
relatedLinks
;
return
!!
this
.
mr
.
relatedLinks
;
},
shouldRenderDeployments
()
{
return
this
.
mr
.
deployments
.
length
;
...
...
spec/javascripts/vue_mr_widget/mr_widget_options_spec.js
View file @
81862c2d
...
...
@@ -3,13 +3,7 @@ import mrWidgetOptions from '~/vue_merge_request_widget/mr_widget_options';
import
eventHub
from
'~/vue_merge_request_widget/event_hub'
;
import
notify
from
'~/lib/utils/notify'
;
import
mockData
from
'./mock_data'
;
const
createComponent
=
()
=>
{
delete
mrWidgetOptions
.
el
;
// Prevent component mounting
gl
.
mrWidgetData
=
mockData
;
const
Component
=
Vue
.
extend
(
mrWidgetOptions
);
return
new
Component
();
};
import
mountComponent
from
'../helpers/vue_mount_component_helper'
;
const
returnPromise
=
data
=>
new
Promise
((
resolve
)
=>
{
resolve
({
...
...
@@ -22,9 +16,16 @@ const returnPromise = data => new Promise((resolve) => {
describe
(
'mrWidgetOptions'
,
()
=>
{
let
vm
;
let
MrWidgetOptions
;
beforeEach
(()
=>
{
vm
=
createComponent
();
// Prevent component mounting
delete
mrWidgetOptions
.
el
;
MrWidgetOptions
=
Vue
.
extend
(
mrWidgetOptions
);
vm
=
mountComponent
(
MrWidgetOptions
,
{
mrData
:
{
...
mockData
},
});
});
describe
(
'data'
,
()
=>
{
...
...
@@ -77,7 +78,7 @@ describe('mrWidgetOptions', () => {
});
it
(
'should return true if there is relatedLinks in MR'
,
()
=>
{
vm
.
mr
.
relatedLinks
=
{}
;
Vue
.
set
(
vm
.
mr
,
'relatedLinks'
,
{})
;
expect
(
vm
.
shouldRenderRelatedLinks
).
toBeTruthy
();
});
});
...
...
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