BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
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', () => {
...
@@ -66,4 +66,38 @@ describe('Dropdown User', () => {
window
.
gon
=
{};
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