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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
9f800079
Commit
9f800079
authored
May 12, 2017
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MRWidget: Fix specs and address WIP comments.
parent
a2dbb693
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
9 deletions
+20
-9
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_nothing_to_merge.js
...st_widget/components/states/mr_widget_nothing_to_merge.js
+4
-7
app/assets/stylesheets/pages/merge_requests.scss
app/assets/stylesheets/pages/merge_requests.scss
+2
-0
spec/javascripts/vue_mr_widget/components/states/mr_widget_nothing_to_merge_spec.js
...dget/components/states/mr_widget_nothing_to_merge_spec.js
+14
-2
No files found.
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_nothing_to_merge.js
View file @
9f800079
...
...
@@ -5,20 +5,17 @@ export default {
props
:
{
mr
:
{
type
:
Object
,
default
:
fals
e
,
required
:
tru
e
,
},
},
data
()
{
return
{
canCreateNewFile
:
true
,
emptyStateSVG
,
};
return
{
emptyStateSVG
};
},
template
:
`
<div class="mr-widget-body empty-state">
<div class="row">
<div class="artwork col-sm-5 col-sm-push-7 col-xs-12 text-center">
<span v-html="emptyStateSVG"
/
>
<span v-html="emptyStateSVG"
></span
>
</div>
<div class="text col-sm-7 col-sm-pull-5 col-xs-12">
<span>
...
...
@@ -33,7 +30,7 @@ export default {
Please push new commits or use a different branch.
</p>
<a
v-if="
canCreateNewFile
"
v-if="
mr.newBlobPath
"
:href="mr.newBlobPath"
role="button"
class="btn btn-inverted btn-save">
...
...
app/assets/stylesheets/pages/merge_requests.scss
View file @
9f800079
...
...
@@ -354,10 +354,12 @@
.artwork
{
margin-bottom
:
$gl-padding
;
}
.text
{
span
{
font-weight
:
bold
;
}
p
{
margin-top
:
$gl-padding
;
}
...
...
spec/javascripts/vue_mr_widget/components/states/mr_widget_nothing_to_merge_spec.js
View file @
9f800079
...
...
@@ -4,14 +4,26 @@ import nothingToMergeComponent from '~/vue_merge_request_widget/components/state
describe
(
'
MRWidgetNothingToMerge
'
,
()
=>
{
describe
(
'
template
'
,
()
=>
{
const
Component
=
Vue
.
extend
(
nothingToMergeComponent
);
const
newBlobPath
=
'
/foo
'
;
const
vm
=
new
Component
({
el
:
document
.
createElement
(
'
div
'
),
propsData
:
{
mr
:
{
newBlobPath
},
},
});
it
(
'
should have correct elements
'
,
()
=>
{
expect
(
vm
.
$el
.
classList
.
contains
(
'
mr-widget-body
'
)).
toBeTruthy
();
expect
(
vm
.
$el
.
querySelector
(
'
button
'
).
getAttribute
(
'
disabled
'
)).
toBeTruthy
(
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
There is nothing to merge from source branch into target branch.
'
);
expect
(
vm
.
$el
.
querySelector
(
'
a
'
).
href
).
toContain
(
newBlobPath
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
"
Currently there are no changes in this merge request's source branch
"
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
Please push new commits or use a different branch.
'
);
});
it
(
'
should not show new blob link if there is no link available
'
,
()
=>
{
vm
.
mr
.
newBlobPath
=
null
;
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
a
'
)).
toEqual
(
null
);
});
});
});
});
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