gitlab-org--gitlab-foss/spec/javascripts/application_spec.js.coffee
2016-06-23 11:21:35 -06:00

30 lines
725 B
CoffeeScript

#= require lib/utils/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