diff options
author | Phil Hughes <me@iamphill.com> | 2018-04-25 10:51:41 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-04-25 10:51:41 +0100 |
commit | 9990afb92c28c94e89a1c81c8b2f2c02c04dc86b (patch) | |
tree | aecb679c6954c85b435b9fcad5c5199cde34b9b6 /spec/javascripts/gl_dropdown_spec.js | |
parent | 10bba03843c155beb58b9d054029d2083776cc56 (diff) | |
parent | b36941bdaad03eeb5ab23235b77f1bfad0348f18 (diff) | |
download | gitlab-ce-9990afb92c28c94e89a1c81c8b2f2c02c04dc86b.tar.gz |
Merge branch 'master' into ide-temp-file-folder-fixes
Diffstat (limited to 'spec/javascripts/gl_dropdown_spec.js')
-rw-r--r-- | spec/javascripts/gl_dropdown_spec.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/spec/javascripts/gl_dropdown_spec.js b/spec/javascripts/gl_dropdown_spec.js index 5393502196e..7f9c4811fba 100644 --- a/spec/javascripts/gl_dropdown_spec.js +++ b/spec/javascripts/gl_dropdown_spec.js @@ -1,9 +1,8 @@ /* eslint-disable comma-dangle, no-param-reassign, no-unused-expressions, max-len */ import $ from 'jquery'; -import '~/gl_dropdown'; +import GLDropdown from '~/gl_dropdown'; import '~/lib/utils/common_utils'; -import * as urlUtils from '~/lib/utils/url_utility'; describe('glDropdown', function describeDropdown() { preloadFixtures('static/gl_dropdown.html.raw'); @@ -138,13 +137,13 @@ describe('glDropdown', function describeDropdown() { expect(this.dropdownContainerElement).toHaveClass('open'); const randomIndex = Math.floor(Math.random() * (this.projectsData.length - 1)) + 0; navigateWithKeys('down', randomIndex, () => { - spyOn(urlUtils, 'visitUrl').and.stub(); + const visitUrl = spyOnDependency(GLDropdown, 'visitUrl').and.stub(); navigateWithKeys('enter', null, () => { expect(this.dropdownContainerElement).not.toHaveClass('open'); const link = $(`${ITEM_SELECTOR}:eq(${randomIndex}) a`, this.$dropdownMenuElement); expect(link).toHaveClass('is-active'); const linkedLocation = link.attr('href'); - if (linkedLocation && linkedLocation !== '#') expect(urlUtils.visitUrl).toHaveBeenCalledWith(linkedLocation); + if (linkedLocation && linkedLocation !== '#') expect(visitUrl).toHaveBeenCalledWith(linkedLocation); }); }); }); |