diff options
| author | Felipe Artur <felipefac@gmail.com> | 2016-06-17 12:38:49 -0300 |
|---|---|---|
| committer | Felipe Artur <felipefac@gmail.com> | 2016-06-17 14:29:11 -0300 |
| commit | e5aa902860fcc2380fd25a6a4f0736dae159eba3 (patch) | |
| tree | ba3c678a476bc7153490da412ebd64223c155c1c /spec/javascripts/application_spec.js.coffee | |
| parent | ab236c76247d83c190b148acbffa48f244414553 (diff) | |
| parent | ae4491b42181f7195199fd6ac9273891d6e48263 (diff) | |
| download | gitlab-ce-issue_12758.tar.gz | |
Merge master into issue_12758issue_12758
Diffstat (limited to 'spec/javascripts/application_spec.js.coffee')
| -rw-r--r-- | spec/javascripts/application_spec.js.coffee | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/javascripts/application_spec.js.coffee b/spec/javascripts/application_spec.js.coffee new file mode 100644 index 00000000000..8af39c41f2f --- /dev/null +++ b/spec/javascripts/application_spec.js.coffee @@ -0,0 +1,30 @@ +#= require lib/common_utils + +describe 'Application', -> + describe 'disable buttons', -> + fixture.preload('application.html') + + beforeEach -> + fixture.load('application.html') + + it 'should prevent default action for disabled buttons', -> + + gl.utils.preventDisabledButtons() + + isClicked = false + $button = $ '#test-button' + + $button.click -> isClicked = true + $button.trigger 'click' + + expect(isClicked).toBe false + + + it 'should be on the same page if a disabled link clicked', -> + + locationBeforeLinkClick = window.location.href + gl.utils.preventDisabledButtons() + + $('#test-link').click() + + expect(window.location.href).toBe locationBeforeLinkClick |
