summaryrefslogtreecommitdiff
path: root/spec/javascripts/filtered_search/dropdown_user_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/javascripts/filtered_search/dropdown_user_spec.js')
-rw-r--r--spec/javascripts/filtered_search/dropdown_user_spec.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/javascripts/filtered_search/dropdown_user_spec.js b/spec/javascripts/filtered_search/dropdown_user_spec.js
index b48b1456eff..e8fcc8592eb 100644
--- a/spec/javascripts/filtered_search/dropdown_user_spec.js
+++ b/spec/javascripts/filtered_search/dropdown_user_spec.js
@@ -28,14 +28,14 @@ describe('Dropdown User', () => {
it('should not return the single quote found in value', () => {
spyOn(FilteredSearchTokenizer, 'processTokens').and.returnValue({
- lastToken: '\'larry boy',
+ lastToken: "'larry boy",
});
expect(dropdownUser.getSearchInput()).toBe('larry boy');
});
});
- describe('config AjaxFilter\'s endpoint', () => {
+ describe("config AjaxFilter's endpoint", () => {
beforeEach(() => {
spyOn(DropdownUser.prototype, 'bindEvents').and.callFake(() => {});
spyOn(DropdownUser.prototype, 'getProjectId').and.callFake(() => {});
@@ -88,10 +88,12 @@ describe('Dropdown User', () => {
});
});
- const findCurrentUserElement = () => authorFilterDropdownElement.querySelector('.js-current-user');
+ const findCurrentUserElement = () =>
+ authorFilterDropdownElement.querySelector('.js-current-user');
it('hides the current user from dropdown', () => {
const currentUserElement = findCurrentUserElement();
+
expect(currentUserElement).not.toBe(null);
dropdown.hideCurrentUser();
@@ -102,6 +104,7 @@ describe('Dropdown User', () => {
it('does nothing if no user is logged in', () => {
const currentUserElement = findCurrentUserElement();
currentUserElement.parentNode.removeChild(currentUserElement);
+
expect(findCurrentUserElement()).toBe(null);
dropdown.hideCurrentUser();