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
598ccd17
Commit
598ccd17
authored
Oct 18, 2019
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wait for event handlers to be set up
Fixes flaky specs where clicking happened too fast
parent
7dd2deb1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
app/assets/javascripts/search_autocomplete.js
app/assets/javascripts/search_autocomplete.js
+4
-4
doc/development/testing_guide/flaky_tests.md
doc/development/testing_guide/flaky_tests.md
+1
-0
spec/features/search/user_uses_header_search_field_spec.rb
spec/features/search/user_uses_header_search_field_spec.rb
+1
-2
No files found.
app/assets/javascripts/search_autocomplete.js
View file @
598ccd17
...
@@ -95,10 +95,10 @@ export class SearchAutocomplete {
...
@@ -95,10 +95,10 @@ export class SearchAutocomplete {
this
.
createAutocomplete
();
this
.
createAutocomplete
();
}
}
this
.
searchInput
.
addClass
(
'
disabled
'
);
this
.
saveTextLength
();
this
.
saveTextLength
();
this
.
bindEvents
();
this
.
bindEvents
();
this
.
dropdownToggle
.
dropdown
();
this
.
dropdownToggle
.
dropdown
();
this
.
searchInput
.
addClass
(
'
js-autocomplete-disabled
'
);
}
}
// Finds an element inside wrapper element
// Finds an element inside wrapper element
...
@@ -338,7 +338,7 @@ export class SearchAutocomplete {
...
@@ -338,7 +338,7 @@ export class SearchAutocomplete {
if
(
!
this
.
dropdown
.
hasClass
(
'
show
'
))
{
if
(
!
this
.
dropdown
.
hasClass
(
'
show
'
))
{
this
.
loadingSuggestions
=
false
;
this
.
loadingSuggestions
=
false
;
this
.
dropdownToggle
.
dropdown
(
'
toggle
'
);
this
.
dropdownToggle
.
dropdown
(
'
toggle
'
);
return
this
.
searchInput
.
removeClass
(
'
disabled
'
);
return
this
.
searchInput
.
removeClass
(
'
js-autocomplete-
disabled
'
);
}
}
}
}
...
@@ -432,8 +432,8 @@ export class SearchAutocomplete {
...
@@ -432,8 +432,8 @@ export class SearchAutocomplete {
}
}
disableAutocomplete
()
{
disableAutocomplete
()
{
if
(
!
this
.
searchInput
.
hasClass
(
'
disabled
'
)
&&
this
.
dropdown
.
hasClass
(
'
show
'
))
{
if
(
!
this
.
searchInput
.
hasClass
(
'
js-autocomplete-
disabled
'
)
&&
this
.
dropdown
.
hasClass
(
'
show
'
))
{
this
.
searchInput
.
addClass
(
'
disabled
'
);
this
.
searchInput
.
addClass
(
'
js-autocomplete-
disabled
'
);
this
.
dropdown
.
removeClass
(
'
show
'
).
trigger
(
'
hidden.bs.dropdown
'
);
this
.
dropdown
.
removeClass
(
'
show
'
).
trigger
(
'
hidden.bs.dropdown
'
);
this
.
restoreMenu
();
this
.
restoreMenu
();
}
}
...
...
doc/development/testing_guide/flaky_tests.md
View file @
598ccd17
...
@@ -83,6 +83,7 @@ This was originally implemented in: <https://gitlab.com/gitlab-org/gitlab-foss/m
...
@@ -83,6 +83,7 @@ This was originally implemented in: <https://gitlab.com/gitlab-org/gitlab-foss/m
-
In JS tests, shifting elements can cause Capybara to misclick when the element moves at the exact time Capybara sends the click
-
In JS tests, shifting elements can cause Capybara to misclick when the element moves at the exact time Capybara sends the click
-
[
Dropdowns rendering upward or downward due to window size and scroll position
](
https://gitlab.com/gitlab-org/gitlab/merge_requests/17660
)
-
[
Dropdowns rendering upward or downward due to window size and scroll position
](
https://gitlab.com/gitlab-org/gitlab/merge_requests/17660
)
-
[
Lazy loaded images can cause Capybara to misclick
](
https://gitlab.com/gitlab-org/gitlab/merge_requests/18713
)
-
[
Lazy loaded images can cause Capybara to misclick
](
https://gitlab.com/gitlab-org/gitlab/merge_requests/18713
)
-
[
Triggering JS events before the event handlers are set up
](
https://gitlab.com/gitlab-org/gitlab/merge_requests/18742
)
#### Capybara viewport size related issues
#### Capybara viewport size related issues
...
...
spec/features/search/user_uses_header_search_field_spec.rb
View file @
598ccd17
...
@@ -28,8 +28,7 @@ describe 'User uses header search field', :js do
...
@@ -28,8 +28,7 @@ describe 'User uses header search field', :js do
context
'when clicking the search field'
do
context
'when clicking the search field'
do
before
do
before
do
page
.
find
(
'#search'
).
click
page
.
find
(
'#search.js-autocomplete-disabled'
).
click
wait_for_all_requests
end
end
it
'shows category search dropdown'
do
it
'shows category search dropdown'
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