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
d2649bf8
Commit
d2649bf8
authored
Jan 09, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bypass Chrome "focus" event bugs and prevent Turbolinks from triggering
parent
5ffbb5de
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
spec/javascripts/search_autocomplete_spec.js
spec/javascripts/search_autocomplete_spec.js
+8
-6
No files found.
spec/javascripts/search_autocomplete_spec.js
View file @
d2649bf8
...
@@ -112,13 +112,15 @@ require('vendor/fuzzaldrin-plus');
...
@@ -112,13 +112,15 @@ require('vendor/fuzzaldrin-plus');
preloadFixtures
(
'
static/search_autocomplete.html.raw
'
);
preloadFixtures
(
'
static/search_autocomplete.html.raw
'
);
beforeEach
(
function
()
{
beforeEach
(
function
()
{
loadFixtures
(
'
static/search_autocomplete.html.raw
'
);
loadFixtures
(
'
static/search_autocomplete.html.raw
'
);
return
widget
=
new
gl
.
SearchAutocomplete
;
widget
=
new
gl
.
SearchAutocomplete
;
// Prevent turbolinks from triggering within gl_dropdown
spyOn
(
window
.
Turbolinks
,
'
visit
'
).
and
.
returnValue
(
true
);
});
});
it
(
'
should show Dashboard specific dropdown menu
'
,
function
()
{
it
(
'
should show Dashboard specific dropdown menu
'
,
function
()
{
var
list
;
var
list
;
addBodyAttributes
();
addBodyAttributes
();
mockDashboardOptions
();
mockDashboardOptions
();
widget
.
searchInput
.
focus
(
);
widget
.
searchInput
.
triggerHandler
(
'
focus
'
);
list
=
widget
.
wrap
.
find
(
'
.dropdown-menu
'
).
find
(
'
ul
'
);
list
=
widget
.
wrap
.
find
(
'
.dropdown-menu
'
).
find
(
'
ul
'
);
return
assertLinks
(
list
,
dashboardIssuesPath
,
dashboardMRsPath
);
return
assertLinks
(
list
,
dashboardIssuesPath
,
dashboardMRsPath
);
});
});
...
@@ -126,7 +128,7 @@ require('vendor/fuzzaldrin-plus');
...
@@ -126,7 +128,7 @@ require('vendor/fuzzaldrin-plus');
var
list
;
var
list
;
addBodyAttributes
(
'
group
'
);
addBodyAttributes
(
'
group
'
);
mockGroupOptions
();
mockGroupOptions
();
widget
.
searchInput
.
focus
(
);
widget
.
searchInput
.
triggerHandler
(
'
focus
'
);
list
=
widget
.
wrap
.
find
(
'
.dropdown-menu
'
).
find
(
'
ul
'
);
list
=
widget
.
wrap
.
find
(
'
.dropdown-menu
'
).
find
(
'
ul
'
);
return
assertLinks
(
list
,
groupIssuesPath
,
groupMRsPath
);
return
assertLinks
(
list
,
groupIssuesPath
,
groupMRsPath
);
});
});
...
@@ -134,7 +136,7 @@ require('vendor/fuzzaldrin-plus');
...
@@ -134,7 +136,7 @@ require('vendor/fuzzaldrin-plus');
var
list
;
var
list
;
addBodyAttributes
(
'
project
'
);
addBodyAttributes
(
'
project
'
);
mockProjectOptions
();
mockProjectOptions
();
widget
.
searchInput
.
focus
(
);
widget
.
searchInput
.
triggerHandler
(
'
focus
'
);
list
=
widget
.
wrap
.
find
(
'
.dropdown-menu
'
).
find
(
'
ul
'
);
list
=
widget
.
wrap
.
find
(
'
.dropdown-menu
'
).
find
(
'
ul
'
);
return
assertLinks
(
list
,
projectIssuesPath
,
projectMRsPath
);
return
assertLinks
(
list
,
projectIssuesPath
,
projectMRsPath
);
});
});
...
@@ -143,7 +145,7 @@ require('vendor/fuzzaldrin-plus');
...
@@ -143,7 +145,7 @@ require('vendor/fuzzaldrin-plus');
addBodyAttributes
(
'
project
'
);
addBodyAttributes
(
'
project
'
);
mockProjectOptions
();
mockProjectOptions
();
widget
.
searchInput
.
val
(
'
help
'
);
widget
.
searchInput
.
val
(
'
help
'
);
widget
.
searchInput
.
focus
(
);
widget
.
searchInput
.
triggerHandler
(
'
focus
'
);
list
=
widget
.
wrap
.
find
(
'
.dropdown-menu
'
).
find
(
'
ul
'
);
list
=
widget
.
wrap
.
find
(
'
.dropdown-menu
'
).
find
(
'
ul
'
);
link
=
"
a[href='
"
+
projectIssuesPath
+
"
/?assignee_id=
"
+
userId
+
"
']
"
;
link
=
"
a[href='
"
+
projectIssuesPath
+
"
/?assignee_id=
"
+
userId
+
"
']
"
;
return
expect
(
list
.
find
(
link
).
length
).
toBe
(
0
);
return
expect
(
list
.
find
(
link
).
length
).
toBe
(
0
);
...
@@ -154,7 +156,7 @@ require('vendor/fuzzaldrin-plus');
...
@@ -154,7 +156,7 @@ require('vendor/fuzzaldrin-plus');
addBodyAttributes
();
addBodyAttributes
();
mockDashboardOptions
(
true
);
mockDashboardOptions
(
true
);
var
submitSpy
=
spyOnEvent
(
'
form
'
,
'
submit
'
);
var
submitSpy
=
spyOnEvent
(
'
form
'
,
'
submit
'
);
widget
.
searchInput
.
focus
(
);
widget
.
searchInput
.
triggerHandler
(
'
focus
'
);
widget
.
wrap
.
trigger
(
$
.
Event
(
'
keydown
'
,
{
which
:
DOWN
}));
widget
.
wrap
.
trigger
(
$
.
Event
(
'
keydown
'
,
{
which
:
DOWN
}));
var
enterKeyEvent
=
$
.
Event
(
'
keydown
'
,
{
which
:
ENTER
});
var
enterKeyEvent
=
$
.
Event
(
'
keydown
'
,
{
which
:
ENTER
});
widget
.
searchInput
.
trigger
(
enterKeyEvent
);
widget
.
searchInput
.
trigger
(
enterKeyEvent
);
...
...
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