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
43b69832
Commit
43b69832
authored
Sep 04, 2020
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes the styling of the resolve thread button
Moves the resolve thread button to the GitLab UI button component
parent
e2e3b618
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
app/assets/javascripts/notes/components/discussion_resolve_button.vue
...avascripts/notes/components/discussion_resolve_button.vue
+4
-5
spec/frontend/notes/components/discussion_resolve_button_spec.js
...ontend/notes/components/discussion_resolve_button_spec.js
+8
-7
No files found.
app/assets/javascripts/notes/components/discussion_resolve_button.vue
View file @
43b69832
<
script
>
import
{
Gl
LoadingIc
on
}
from
'
@gitlab/ui
'
;
import
{
Gl
Butt
on
}
from
'
@gitlab/ui
'
;
export
default
{
name
:
'
ResolveDiscussionButton
'
,
components
:
{
Gl
LoadingIc
on
,
Gl
Butt
on
,
},
props
:
{
isResolving
:
{
...
...
@@ -21,8 +21,7 @@ export default {
</
script
>
<
template
>
<button
ref=
"button"
type=
"button"
class=
"btn btn-default ml-sm-2"
@
click=
"$emit('onClick')"
>
<gl-loading-icon
v-if=
"isResolving"
ref=
"isResolvingIcon"
inline
/>
<gl-button
:loading=
"isResolving"
class=
"ml-sm-2"
@
click=
"$emit('onClick')"
>
{{
buttonTitle
}}
</button>
</
gl-
button>
</
template
>
spec/frontend/notes/components/discussion_resolve_button_spec.js
View file @
43b69832
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
resolveDiscussionButton
from
'
~/notes/components/discussion_resolve_button.vue
'
;
const
buttonTitle
=
'
Resolve discussion
'
;
...
...
@@ -26,9 +27,9 @@ describe('resolveDiscussionButton', () => {
});
it
(
'
should emit a onClick event on button click
'
,
()
=>
{
const
button
=
wrapper
.
find
(
{
ref
:
'
button
'
}
);
const
button
=
wrapper
.
find
(
GlButton
);
button
.
trigger
(
'
click
'
);
button
.
vm
.
$emit
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
emitted
()).
toEqual
({
...
...
@@ -38,7 +39,7 @@ describe('resolveDiscussionButton', () => {
});
it
(
'
should contain the provided button title
'
,
()
=>
{
const
button
=
wrapper
.
find
(
{
ref
:
'
button
'
}
);
const
button
=
wrapper
.
find
(
GlButton
);
expect
(
button
.
text
()).
toContain
(
buttonTitle
);
});
...
...
@@ -51,9 +52,9 @@ describe('resolveDiscussionButton', () => {
},
});
const
button
=
wrapper
.
find
(
{
ref
:
'
isResolvingIcon
'
}
);
const
button
=
wrapper
.
find
(
GlButton
);
expect
(
button
.
exists
(
)).
toEqual
(
true
);
expect
(
button
.
props
(
'
loading
'
)).
toEqual
(
true
);
});
it
(
'
should only show a loading spinner while resolving
'
,
()
=>
{
...
...
@@ -64,10 +65,10 @@ describe('resolveDiscussionButton', () => {
},
});
const
button
=
wrapper
.
find
(
{
ref
:
'
isResolvingIcon
'
}
);
const
button
=
wrapper
.
find
(
GlButton
);
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
button
.
exists
(
)).
toEqual
(
false
);
expect
(
button
.
props
(
'
loading
'
)).
toEqual
(
false
);
});
});
});
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