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
34d378a1
Commit
34d378a1
authored
Apr 29, 2020
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes confirm box not showing when users cancelling reply form
Closes
https://gitlab.com/gitlab-org/gitlab/-/issues/33586
parent
fe0f7e1a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
8 deletions
+31
-8
app/assets/javascripts/notes/components/note_form.vue
app/assets/javascripts/notes/components/note_form.vue
+4
-2
changelogs/unreleased/ph-33586-confirmCancelReply.yml
changelogs/unreleased/ph-33586-confirmCancelReply.yml
+5
-0
ee/spec/frontend/notes/components/note_form_spec.js
ee/spec/frontend/notes/components/note_form_spec.js
+11
-0
spec/features/merge_request/user_posts_diff_notes_spec.rb
spec/features/merge_request/user_posts_diff_notes_spec.rb
+3
-1
spec/features/merge_request/user_posts_notes_spec.rb
spec/features/merge_request/user_posts_notes_spec.rb
+4
-1
spec/frontend/notes/components/note_form_spec.js
spec/frontend/notes/components/note_form_spec.js
+4
-4
No files found.
app/assets/javascripts/notes/components/note_form.vue
View file @
34d378a1
...
@@ -328,7 +328,8 @@ export default {
...
@@ -328,7 +328,8 @@ export default {
<button
<button
class=
"btn note-edit-cancel js-close-discussion-note-form"
class=
"btn note-edit-cancel js-close-discussion-note-form"
type=
"button"
type=
"button"
@
click=
"cancelHandler()"
data-testid=
"cancelBatchCommentsEnabled"
@
click=
"cancelHandler(true)"
>
>
{{ __('Cancel') }}
{{ __('Cancel') }}
</button>
</button>
...
@@ -353,7 +354,8 @@ export default {
...
@@ -353,7 +354,8 @@ export default {
<button
<button
class=
"btn btn-cancel note-edit-cancel js-close-discussion-note-form"
class=
"btn btn-cancel note-edit-cancel js-close-discussion-note-form"
type=
"button"
type=
"button"
@
click=
"cancelHandler()"
data-testid=
"cancel"
@
click=
"cancelHandler(true)"
>
>
{{
__
(
'
Cancel
'
)
}}
{{
__
(
'
Cancel
'
)
}}
</button>
</button>
...
...
changelogs/unreleased/ph-33586-confirmCancelReply.yml
0 → 100644
View file @
34d378a1
---
title
:
Fixed cancel reply button not alerting the user
merge_request
:
author
:
type
:
fixed
ee/spec/frontend/notes/components/note_form_spec.js
View file @
34d378a1
...
@@ -67,6 +67,17 @@ describe('issue_note_form component', () => {
...
@@ -67,6 +67,17 @@ describe('issue_note_form component', () => {
return
store
.
dispatch
(
'
batchComments/enableBatchComments
'
).
then
(
vm
.
$nextTick
);
return
store
.
dispatch
(
'
batchComments/enableBatchComments
'
).
then
(
vm
.
$nextTick
);
});
});
it
(
'
should be possible to cancel
'
,
()
=>
{
jest
.
spyOn
(
vm
,
'
cancelHandler
'
);
return
vm
.
$nextTick
().
then
(()
=>
{
const
cancelButton
=
vm
.
$el
.
querySelector
(
'
[data-testid="cancelBatchCommentsEnabled"]
'
);
cancelButton
.
click
();
expect
(
vm
.
cancelHandler
).
toHaveBeenCalledWith
(
true
);
});
});
it
(
'
shows resolve checkbox
'
,
()
=>
{
it
(
'
shows resolve checkbox
'
,
()
=>
{
expect
(
expect
(
vm
.
$el
.
querySelector
(
'
[data-qa-selector="resolve_review_discussion_checkbox"]
'
),
vm
.
$el
.
querySelector
(
'
[data-qa-selector="resolve_review_discussion_checkbox"]
'
),
...
...
spec/features/merge_request/user_posts_diff_notes_spec.rb
View file @
34d378a1
...
@@ -235,7 +235,9 @@ describe 'Merge request > User posts diff notes', :js do
...
@@ -235,7 +235,9 @@ describe 'Merge request > User posts diff notes', :js do
def
should_allow_dismissing_a_comment
(
line_holder
,
diff_side
=
nil
)
def
should_allow_dismissing_a_comment
(
line_holder
,
diff_side
=
nil
)
write_comment_on_line
(
line_holder
,
diff_side
)
write_comment_on_line
(
line_holder
,
diff_side
)
find
(
'.js-close-discussion-note-form'
).
click
accept_confirm
do
find
(
'.js-close-discussion-note-form'
).
click
end
assert_comment_dismissal
(
line_holder
)
assert_comment_dismissal
(
line_holder
)
end
end
...
...
spec/features/merge_request/user_posts_notes_spec.rb
View file @
34d378a1
...
@@ -147,7 +147,10 @@ describe 'Merge request > User posts notes', :js do
...
@@ -147,7 +147,10 @@ describe 'Merge request > User posts notes', :js do
it
'resets the edit note form textarea with the original content of the note if cancelled'
do
it
'resets the edit note form textarea with the original content of the note if cancelled'
do
within
(
'.current-note-edit-form'
)
do
within
(
'.current-note-edit-form'
)
do
fill_in
'note[note]'
,
with:
'Some new content'
fill_in
'note[note]'
,
with:
'Some new content'
find
(
'.btn-cancel'
).
click
accept_confirm
do
find
(
'.btn-cancel'
).
click
end
end
end
expect
(
find
(
'.js-note-text'
).
text
).
to
eq
''
expect
(
find
(
'.js-note-text'
).
text
).
to
eq
''
end
end
...
...
spec/frontend/notes/components/note_form_spec.js
View file @
34d378a1
...
@@ -161,18 +161,18 @@ describe('issue_note_form component', () => {
...
@@ -161,18 +161,18 @@ describe('issue_note_form component', () => {
describe
(
'
actions
'
,
()
=>
{
describe
(
'
actions
'
,
()
=>
{
it
(
'
should be possible to cancel
'
,
()
=>
{
it
(
'
should be possible to cancel
'
,
()
=>
{
// TODO: do not spy on vm
const
cancelHandler
=
jest
.
fn
();
jest
.
spyOn
(
wrapper
.
vm
,
'
cancelHandler
'
);
wrapper
.
setProps
({
wrapper
.
setProps
({
...
props
,
...
props
,
isEditing
:
true
,
isEditing
:
true
,
});
});
wrapper
.
setMethods
({
cancelHandler
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
const
cancelButton
=
wrapper
.
find
(
'
.note-edit-cancel
'
);
const
cancelButton
=
wrapper
.
find
(
'
[data-testid="cancel"]
'
);
cancelButton
.
trigger
(
'
click
'
);
cancelButton
.
trigger
(
'
click
'
);
expect
(
wrapper
.
vm
.
cancelHandler
).
toHaveBeenCalled
(
);
expect
(
cancelHandler
).
toHaveBeenCalledWith
(
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