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
52b9797a
Commit
52b9797a
authored
Apr 24, 2019
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid quick action prompt blocking preview button
parent
65a7a20a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
spec/support/helpers/features/notes_helpers.rb
spec/support/helpers/features/notes_helpers.rb
+11
-1
spec/support/shared_examples/quick_actions/issuable/close_quick_action_shared_examples.rb
...ck_actions/issuable/close_quick_action_shared_examples.rb
+3
-4
No files found.
spec/support/helpers/features/notes_helpers.rb
View file @
52b9797a
...
...
@@ -23,8 +23,18 @@ module Spec
def
preview_note
(
text
)
page
.
within
(
'.js-main-target-form'
)
do
fill_in
(
'note[note]'
,
with:
text
)
filled_text
=
fill_in
(
'note[note]'
,
with:
text
)
begin
# Dismiss quick action prompt if it appears
filled_text
.
parent
.
send_keys
(
:escape
)
rescue
Selenium
::
WebDriver
::
Error
::
ElementNotInteractableError
# It's fine if we can't escape when there's no prompt.
end
click_on
(
'Preview'
)
yield
if
block_given?
end
end
end
...
...
spec/support/shared_examples/quick_actions/issuable/close_quick_action_shared_examples.rb
View file @
52b9797a
# frozen_string_literal: true
shared_examples
'close quick action'
do
|
issuable_type
|
include
Spec
::
Support
::
Helpers
::
Features
::
NotesHelpers
before
do
project
.
add_maintainer
(
maintainer
)
gitlab_sign_in
(
maintainer
)
...
...
@@ -76,10 +78,7 @@ shared_examples 'close quick action' do |issuable_type|
it
'explains close quick action'
do
visit
public_send
(
"project_
#{
issuable_type
}
_path"
,
project
,
issuable
)
page
.
within
(
'.js-main-target-form'
)
do
fill_in
'note[note]'
,
with:
"this is done, close
\n
/close"
click_on
'Preview'
preview_note
(
"this is done, close
\n
/close"
)
do
expect
(
page
).
not_to
have_content
'/close'
expect
(
page
).
to
have_content
'this is done, close'
expect
(
page
).
to
have_content
"Closes this
#{
issuable_type
.
to_s
.
humanize
.
downcase
}
."
...
...
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