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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
abfb5910
Commit
abfb5910
authored
Jun 27, 2017
by
winh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add failing test for #34141
parent
ad3843ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
spec/javascripts/filtered_search/dropdown_user_spec.js
spec/javascripts/filtered_search/dropdown_user_spec.js
+34
-0
No files found.
spec/javascripts/filtered_search/dropdown_user_spec.js
View file @
abfb5910
...
...
@@ -66,4 +66,38 @@ describe('Dropdown User', () => {
window
.
gon
=
{};
});
});
describe
(
'
hideCurrentUser
'
,
()
=>
{
const
fixtureTemplate
=
'
issues/issue_list.html.raw
'
;
preloadFixtures
(
fixtureTemplate
);
let
dropdown
;
let
authorFilterDropdownElement
;
beforeEach
(()
=>
{
loadFixtures
(
fixtureTemplate
);
authorFilterDropdownElement
=
document
.
querySelector
(
'
#js-dropdown-author
'
);
const
dummyInput
=
document
.
createElement
(
'
div
'
);
dropdown
=
new
gl
.
DropdownUser
(
null
,
authorFilterDropdownElement
,
dummyInput
);
});
const
findCurrentUserElement
=
()
=>
authorFilterDropdownElement
.
querySelector
(
'
.js-current-user
'
);
it
(
'
hides the current user from dropdown
'
,
()
=>
{
const
currentUserElement
=
findCurrentUserElement
();
expect
(
currentUserElement
).
not
.
toBe
(
null
);
dropdown
.
hideCurrentUser
();
expect
(
currentUserElement
.
classList
).
toContain
(
'
hidden
'
);
});
it
(
'
does nothing if no user is logged in
'
,
()
=>
{
const
currentUserElement
=
findCurrentUserElement
();
currentUserElement
.
parentNode
.
removeChild
(
currentUserElement
);
expect
(
findCurrentUserElement
()).
toBe
(
null
);
dropdown
.
hideCurrentUser
();
});
});
});
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