diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2016-07-08 04:00:45 +0300 |
---|---|---|
committer | Luke Bennett <lukeeeebennettplus@gmail.com> | 2016-08-18 20:17:56 +0300 |
commit | 1ac5f764cecdeaa4b41a77353a979f941cf0e72b (patch) | |
tree | a3d703289c065361f7696b7204b9fa557542c677 /spec/javascripts | |
parent | 40d869eefa2c491446b6aa75ec1337add6ce3e4a (diff) |
Fixed test turbolink condition
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/gl_dropdown_spec.js.coffee | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/javascripts/gl_dropdown_spec.js.coffee b/spec/javascripts/gl_dropdown_spec.js.coffee index 46a0af32a7d..a4b3f519745 100644 --- a/spec/javascripts/gl_dropdown_spec.js.coffee +++ b/spec/javascripts/gl_dropdown_spec.js.coffee @@ -81,11 +81,12 @@ describe 'Dropdown', -> navigateWithKeys 'down', randomIndex, => spyOn(Turbolinks, 'visit').and.stub() navigateWithKeys 'enter', null, => + expect(@dropdownContainerElement).not.toHaveClass 'open' link = $("#{ITEM_SELECTOR}:eq(#{randomIndex}) a", @dropdownMenuElement) expect(link).toHaveClass 'is-active' - if link.attr 'href' - expect(Turbolinks.visit).toHaveBeenCalledWith link.attr 'href' - expect(@dropdownContainerElement).not.toHaveClass 'open' + linkedLocation = link.attr 'href' + if linkedLocation and linkedLocation isnt '#' + expect(Turbolinks.visit).toHaveBeenCalledWith linkedLocation it 'should close on ESC keypress', -> expect(@dropdownContainerElement).toHaveClass 'open' |