diff options
author | winniehell <git@winniehell.de> | 2016-08-26 10:54:17 +0200 |
---|---|---|
committer | winniehell <git@winniehell.de> | 2016-08-26 10:57:59 +0200 |
commit | bfd14f876388f6c9a4006ae270b8a98912415226 (patch) | |
tree | fa0a67fe011a364932d5989e56f571a8a25c1a07 /spec | |
parent | 9704fa22c58b4485a4a5c20e6598a1a6556dd0ec (diff) | |
download | gitlab-ce-bfd14f876388f6c9a4006ae270b8a98912415226.tar.gz |
Check for existence of elements under test in application_spec.js (!6051)
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/application_spec.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/javascripts/application_spec.js b/spec/javascripts/application_spec.js index b48026c3b77..56b98856614 100644 --- a/spec/javascripts/application_spec.js +++ b/spec/javascripts/application_spec.js @@ -13,17 +13,21 @@ gl.utils.preventDisabledButtons(); isClicked = false; $button = $('#test-button'); + expect($button).toExist(); $button.click(function() { return isClicked = true; }); $button.trigger('click'); return expect(isClicked).toBe(false); }); - return it('should be on the same page if a disabled link clicked', function() { - var locationBeforeLinkClick; + + it('should be on the same page if a disabled link clicked', function() { + var locationBeforeLinkClick, $link; locationBeforeLinkClick = window.location.href; gl.utils.preventDisabledButtons(); - $('#test-link').click(); + $link = $('#test-link'); + expect($link).toExist(); + $link.click(); return expect(window.location.href).toBe(locationBeforeLinkClick); }); }); |