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
7 years ago
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MRWidget: Fix specs and address WIP comments.
parent
a2dbb693
Changes
3
Hide 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 {
...
@@ -5,20 +5,17 @@ export default {
props
:
{
props
:
{
mr
:
{
mr
:
{
type
:
Object
,
type
:
Object
,
default
:
fals
e
,
required
:
tru
e
,
},
},
},
},
data
()
{
data
()
{
return
{
return
{
emptyStateSVG
};
canCreateNewFile
:
true
,
emptyStateSVG
,
};
},
},
template
:
`
template
:
`
<div class="mr-widget-body empty-state">
<div class="mr-widget-body empty-state">
<div class="row">
<div class="row">
<div class="artwork col-sm-5 col-sm-push-7 col-xs-12 text-center">
<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>
<div class="text col-sm-7 col-sm-pull-5 col-xs-12">
<div class="text col-sm-7 col-sm-pull-5 col-xs-12">
<span>
<span>
...
@@ -33,7 +30,7 @@ export default {
...
@@ -33,7 +30,7 @@ export default {
Please push new commits or use a different branch.
Please push new commits or use a different branch.
</p>
</p>
<a
<a
v-if="
canCreateNewFile
"
v-if="
mr.newBlobPath
"
:href="mr.newBlobPath"
:href="mr.newBlobPath"
role="button"
role="button"
class="btn btn-inverted btn-save">
class="btn btn-inverted btn-save">
...
...
This diff is collapsed.
Click to expand it.
app/assets/stylesheets/pages/merge_requests.scss
View file @
9f800079
...
@@ -354,10 +354,12 @@
...
@@ -354,10 +354,12 @@
.artwork
{
.artwork
{
margin-bottom
:
$gl-padding
;
margin-bottom
:
$gl-padding
;
}
}
.text
{
.text
{
span
{
span
{
font-weight
:
bold
;
font-weight
:
bold
;
}
}
p
{
p
{
margin-top
:
$gl-padding
;
margin-top
:
$gl-padding
;
}
}
...
...
This diff is collapsed.
Click to expand it.
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
...
@@ -4,14 +4,26 @@ import nothingToMergeComponent from '~/vue_merge_request_widget/components/state
describe
(
'
MRWidgetNothingToMerge
'
,
()
=>
{
describe
(
'
MRWidgetNothingToMerge
'
,
()
=>
{
describe
(
'
template
'
,
()
=>
{
describe
(
'
template
'
,
()
=>
{
const
Component
=
Vue
.
extend
(
nothingToMergeComponent
);
const
Component
=
Vue
.
extend
(
nothingToMergeComponent
);
const
newBlobPath
=
'
/foo
'
;
const
vm
=
new
Component
({
const
vm
=
new
Component
({
el
:
document
.
createElement
(
'
div
'
),
el
:
document
.
createElement
(
'
div
'
),
propsData
:
{
mr
:
{
newBlobPath
},
},
});
});
it
(
'
should have correct elements
'
,
()
=>
{
it
(
'
should have correct elements
'
,
()
=>
{
expect
(
vm
.
$el
.
classList
.
contains
(
'
mr-widget-body
'
)).
toBeTruthy
();
expect
(
vm
.
$el
.
classList
.
contains
(
'
mr-widget-body
'
)).
toBeTruthy
();
expect
(
vm
.
$el
.
querySelector
(
'
button
'
).
getAttribute
(
'
disabled
'
)).
toBeTruthy
(
);
expect
(
vm
.
$el
.
querySelector
(
'
a
'
).
href
).
toContain
(
newBlobPath
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
There is nothing to merge from source branch into target branch.
'
);
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.
'
);
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
);
});
});
});
});
});
});
This diff is collapsed.
Click to expand it.
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