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
bbcb272e
Commit
bbcb272e
authored
Sep 28, 2020
by
Kevin Comoli
Committed by
Andrew Fontaine
Sep 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Fixing template layout for jest test"
This reverts commit ebda8065ca51a6fe675a011edfe798e617aa038d.
parent
e761ced0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
15 deletions
+13
-15
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_failed.vue
..._widget/components/states/mr_widget_auto_merge_failed.vue
+8
-6
spec/frontend/vue_mr_widget/components/states/mr_widget_auto_merge_failed_spec.js
...get/components/states/mr_widget_auto_merge_failed_spec.js
+5
-9
No files found.
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_failed.vue
View file @
bbcb272e
<
script
>
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
,
GlButton
}
from
'
@gitlab/ui
'
;
import
eventHub
from
'
../../event_hub
'
;
import
statusIcon
from
'
../mr_widget_status_icon.vue
'
;
...
...
@@ -8,6 +8,7 @@ export default {
components
:
{
statusIcon
,
GlLoadingIcon
,
GlButton
,
},
props
:
{
mr
:
{
...
...
@@ -33,20 +34,21 @@ export default {
<
template
>
<div
class=
"mr-widget-body media"
>
<status-icon
status=
"warning"
/>
<div
class=
"media-body space-children"
>
<div
class=
"media-body space-children
gl-display-flex gl-flex-wrap gl-align-items-center
"
>
<span
class=
"bold"
>
<template
v-if=
"mr.mergeError"
>
{{
mr
.
mergeError
}}
</
template
>
{{ s__('mrWidget|This merge request failed to be merged automatically') }}
</span>
<button
<
gl-
button
:disabled=
"isRefreshing"
type=
"button"
class=
"btn btn-sm btn-default"
category=
"secondary"
variant=
"default"
size=
"small"
@
click=
"refreshWidget"
>
<gl-loading-icon
v-if=
"isRefreshing"
:inline=
"true"
/>
{{ s__('mrWidget|Refresh') }}
</button>
</
gl-
button>
</div>
</div>
</template>
spec/frontend/vue_mr_widget/components/states/mr_widget_auto_merge_failed_spec.js
View file @
bbcb272e
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
,
GlButton
}
from
'
@gitlab/ui
'
;
import
AutoMergeFailedComponent
from
'
~/vue_merge_request_widget/components/states/mr_widget_auto_merge_failed.vue
'
;
import
eventHub
from
'
~/vue_merge_request_widget/event_hub
'
;
describe
(
'
MRWidgetAutoMergeFailed
'
,
()
=>
{
let
wrapper
;
const
mergeError
=
'
This is the merge error
'
;
const
findButton
=
()
=>
wrapper
.
find
(
'
button
'
);
const
findButton
=
()
=>
wrapper
.
find
(
GlButton
);
const
createComponent
=
(
props
=
{})
=>
{
wrapper
=
shallowMount
(
AutoMergeFailedComponent
,
{
...
...
@@ -38,17 +38,13 @@ describe('MRWidgetAutoMergeFailed', () => {
it
(
'
emits event and shows loading icon when button is clicked
'
,
()
=>
{
jest
.
spyOn
(
eventHub
,
'
$emit
'
);
findButton
().
trigger
(
'
click
'
);
findButton
().
vm
.
$emit
(
'
click
'
);
expect
(
eventHub
.
$emit
.
mock
.
calls
[
0
][
0
]).
toBe
(
'
MRWidgetUpdateRequested
'
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
findButton
().
attributes
(
'
disabled
'
)).
toEqual
(
'
disabled
'
);
expect
(
findButton
()
.
find
(
GlLoadingIcon
)
.
exists
(),
).
toBe
(
true
);
expect
(
findButton
().
attributes
(
'
disabled
'
)).
toBe
(
'
true
'
);
expect
(
wrapper
.
find
(
GlLoadingIcon
).
exists
()).
toBe
(
true
);
});
});
});
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