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
cbdbd246
Commit
cbdbd246
authored
Jul 20, 2017
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IssueNotesRefactor: Fixes autocomplete specs.
parent
d493c16f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
23 deletions
+27
-23
spec/features/issues/gfm_autocomplete_spec.rb
spec/features/issues/gfm_autocomplete_spec.rb
+22
-22
spec/features/participants_autocomplete_spec.rb
spec/features/participants_autocomplete_spec.rb
+5
-1
No files found.
spec/features/issues/gfm_autocomplete_spec.rb
View file @
cbdbd246
...
@@ -28,8 +28,8 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -28,8 +28,8 @@ feature 'GFM autocomplete', feature: true, js: true do
it
'opens autocomplete menu when field starts with text'
do
it
'opens autocomplete menu when field starts with text'
do
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
find
(
'#note
_note
'
).
native
.
send_keys
(
''
)
find
(
'#note
-body
'
).
native
.
send_keys
(
''
)
find
(
'#note
_note
'
).
native
.
send_keys
(
'@'
)
find
(
'#note
-body
'
).
native
.
send_keys
(
'@'
)
end
end
expect
(
page
).
to
have_selector
(
'.atwho-container'
)
expect
(
page
).
to
have_selector
(
'.atwho-container'
)
...
@@ -37,8 +37,8 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -37,8 +37,8 @@ feature 'GFM autocomplete', feature: true, js: true do
it
'doesnt open autocomplete menu character is prefixed with text'
do
it
'doesnt open autocomplete menu character is prefixed with text'
do
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
find
(
'#note
_note
'
).
native
.
send_keys
(
'testing'
)
find
(
'#note
-body
'
).
native
.
send_keys
(
'testing'
)
find
(
'#note
_note
'
).
native
.
send_keys
(
'@'
)
find
(
'#note
-body
'
).
native
.
send_keys
(
'@'
)
end
end
expect
(
page
).
not_to
have_selector
(
'.atwho-view'
)
expect
(
page
).
not_to
have_selector
(
'.atwho-view'
)
...
@@ -46,8 +46,8 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -46,8 +46,8 @@ feature 'GFM autocomplete', feature: true, js: true do
it
'doesnt select the first item for non-assignee dropdowns'
do
it
'doesnt select the first item for non-assignee dropdowns'
do
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
find
(
'#note
_note
'
).
native
.
send_keys
(
''
)
find
(
'#note
-body
'
).
native
.
send_keys
(
''
)
find
(
'#note
_note
'
).
native
.
send_keys
(
':'
)
find
(
'#note
-body
'
).
native
.
send_keys
(
':'
)
end
end
expect
(
page
).
to
have_selector
(
'.atwho-container'
)
expect
(
page
).
to
have_selector
(
'.atwho-container'
)
...
@@ -58,7 +58,7 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -58,7 +58,7 @@ feature 'GFM autocomplete', feature: true, js: true do
end
end
it
'does not open autocomplete menu when ":" is prefixed by a number and letters'
do
it
'does not open autocomplete menu when ":" is prefixed by a number and letters'
do
note
=
find
(
'#note
_note
'
)
note
=
find
(
'#note
-body
'
)
# Number.
# Number.
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
...
@@ -86,8 +86,8 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -86,8 +86,8 @@ feature 'GFM autocomplete', feature: true, js: true do
it
'selects the first item for assignee dropdowns'
do
it
'selects the first item for assignee dropdowns'
do
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
find
(
'#note
_note
'
).
native
.
send_keys
(
''
)
find
(
'#note
-body
'
).
native
.
send_keys
(
''
)
find
(
'#note
_note
'
).
native
.
send_keys
(
'@'
)
find
(
'#note
-body
'
).
native
.
send_keys
(
'@'
)
end
end
expect
(
page
).
to
have_selector
(
'.atwho-container'
)
expect
(
page
).
to
have_selector
(
'.atwho-container'
)
...
@@ -99,8 +99,8 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -99,8 +99,8 @@ feature 'GFM autocomplete', feature: true, js: true do
it
'includes items for assignee dropdowns with non-ASCII characters in name'
do
it
'includes items for assignee dropdowns with non-ASCII characters in name'
do
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
find
(
'#note
_note
'
).
native
.
send_keys
(
''
)
find
(
'#note
-body
'
).
native
.
send_keys
(
''
)
find
(
'#note
_note
'
).
native
.
send_keys
(
"@
#{
user
.
name
[
0
...
8
]
}
"
)
find
(
'#note
-body
'
).
native
.
send_keys
(
"@
#{
user
.
name
[
0
...
8
]
}
"
)
end
end
expect
(
page
).
to
have_selector
(
'.atwho-container'
)
expect
(
page
).
to
have_selector
(
'.atwho-container'
)
...
@@ -112,8 +112,8 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -112,8 +112,8 @@ feature 'GFM autocomplete', feature: true, js: true do
it
'selects the first item for non-assignee dropdowns if a query is entered'
do
it
'selects the first item for non-assignee dropdowns if a query is entered'
do
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
find
(
'#note
_note
'
).
native
.
send_keys
(
''
)
find
(
'#note
-body
'
).
native
.
send_keys
(
''
)
find
(
'#note
_note
'
).
native
.
send_keys
(
':1'
)
find
(
'#note
-body
'
).
native
.
send_keys
(
':1'
)
end
end
expect
(
page
).
to
have_selector
(
'.atwho-container'
)
expect
(
page
).
to
have_selector
(
'.atwho-container'
)
...
@@ -125,7 +125,7 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -125,7 +125,7 @@ feature 'GFM autocomplete', feature: true, js: true do
context
'if a selected value has special characters'
do
context
'if a selected value has special characters'
do
it
'wraps the result in double quotes'
do
it
'wraps the result in double quotes'
do
note
=
find
(
'#note
_note
'
)
note
=
find
(
'#note
-body
'
)
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
"~
#{
label
.
title
[
0
]
}
"
)
note
.
native
.
send_keys
(
"~
#{
label
.
title
[
0
]
}
"
)
...
@@ -138,7 +138,7 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -138,7 +138,7 @@ feature 'GFM autocomplete', feature: true, js: true do
end
end
it
"shows dropdown after a new line"
do
it
"shows dropdown after a new line"
do
note
=
find
(
'#note
_note
'
)
note
=
find
(
'#note
-body
'
)
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
note
.
native
.
send_keys
(
'test'
)
note
.
native
.
send_keys
(
'test'
)
note
.
native
.
send_keys
(
:enter
)
note
.
native
.
send_keys
(
:enter
)
...
@@ -150,7 +150,7 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -150,7 +150,7 @@ feature 'GFM autocomplete', feature: true, js: true do
end
end
it
"does not show dropdown when preceded with a special character"
do
it
"does not show dropdown when preceded with a special character"
do
note
=
find
(
'#note
_note
'
)
note
=
find
(
'#note
-body
'
)
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
"@"
)
note
.
native
.
send_keys
(
"@"
)
...
@@ -168,7 +168,7 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -168,7 +168,7 @@ feature 'GFM autocomplete', feature: true, js: true do
end
end
it
"does not throw an error if no labels exist"
do
it
"does not throw an error if no labels exist"
do
note
=
find
(
'#note
_note
'
)
note
=
find
(
'#note
-body
'
)
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
'~'
)
note
.
native
.
send_keys
(
'~'
)
...
@@ -179,7 +179,7 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -179,7 +179,7 @@ feature 'GFM autocomplete', feature: true, js: true do
end
end
it
'doesn\'t wrap for assignee values'
do
it
'doesn\'t wrap for assignee values'
do
note
=
find
(
'#note
_note
'
)
note
=
find
(
'#note
-body
'
)
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
"@
#{
user
.
username
[
0
]
}
"
)
note
.
native
.
send_keys
(
"@
#{
user
.
username
[
0
]
}
"
)
...
@@ -192,7 +192,7 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -192,7 +192,7 @@ feature 'GFM autocomplete', feature: true, js: true do
end
end
it
'doesn\'t wrap for emoji values'
do
it
'doesn\'t wrap for emoji values'
do
note
=
find
(
'#note
_note
'
)
note
=
find
(
'#note
-body
'
)
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
":cartwheel"
)
note
.
native
.
send_keys
(
":cartwheel"
)
...
@@ -206,7 +206,7 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -206,7 +206,7 @@ feature 'GFM autocomplete', feature: true, js: true do
it
'doesn\'t open autocomplete after non-word character'
do
it
'doesn\'t open autocomplete after non-word character'
do
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
find
(
'#note
_note
'
).
native
.
send_keys
(
"@
#{
user
.
username
[
0
..
2
]
}
!"
)
find
(
'#note
-body
'
).
native
.
send_keys
(
"@
#{
user
.
username
[
0
..
2
]
}
!"
)
end
end
expect
(
page
).
not_to
have_selector
(
'.atwho-view'
)
expect
(
page
).
not_to
have_selector
(
'.atwho-view'
)
...
@@ -214,14 +214,14 @@ feature 'GFM autocomplete', feature: true, js: true do
...
@@ -214,14 +214,14 @@ feature 'GFM autocomplete', feature: true, js: true do
it
'doesn\'t open autocomplete if there is no space before'
do
it
'doesn\'t open autocomplete if there is no space before'
do
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
find
(
'#note
_note
'
).
native
.
send_keys
(
"hello:
#{
user
.
username
[
0
..
2
]
}
"
)
find
(
'#note
-body
'
).
native
.
send_keys
(
"hello:
#{
user
.
username
[
0
..
2
]
}
"
)
end
end
expect
(
page
).
not_to
have_selector
(
'.atwho-view'
)
expect
(
page
).
not_to
have_selector
(
'.atwho-view'
)
end
end
it
'triggers autocomplete after selecting a quick action'
do
it
'triggers autocomplete after selecting a quick action'
do
note
=
find
(
'#note
_note
'
)
note
=
find
(
'#note
-body
'
)
page
.
within
'.timeline-content-form'
do
page
.
within
'.timeline-content-form'
do
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
'/as'
)
note
.
native
.
send_keys
(
'/as'
)
...
...
spec/features/participants_autocomplete_spec.rb
View file @
cbdbd246
...
@@ -14,9 +14,13 @@ feature 'Member autocomplete', :js do
...
@@ -14,9 +14,13 @@ feature 'Member autocomplete', :js do
shared_examples
"open suggestions when typing @"
do
shared_examples
"open suggestions when typing @"
do
before
do
before
do
page
.
within
(
'.new-note'
)
do
page
.
within
(
'.new-note'
)
do
if
note
.
noteable_type
===
'Issue'
find
(
'#note-body'
).
send_keys
(
'@'
)
else
find
(
'#note_note'
).
send_keys
(
'@'
)
find
(
'#note_note'
).
send_keys
(
'@'
)
end
end
end
end
end
it
'suggests noteable author and note author'
do
it
'suggests noteable author and note author'
do
page
.
within
(
'.atwho-view'
,
visible:
true
)
do
page
.
within
(
'.atwho-view'
,
visible:
true
)
do
...
...
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