gitlab-org--gitlab-foss/spec/javascripts/extensions/jquery_spec.js.coffee
Robert Speicher 4560954404 Move jQuery enable/disable extensions to extensions/jquery
Removes redundant enableButton/disableButton extensions, and adds specs
for the jQuery extensions.
2015-06-02 20:32:07 -04:00

34 lines
864 B
CoffeeScript

#= require extensions/jquery
describe 'jQuery extensions', ->
describe 'disable', ->
beforeEach ->
fixture.set '<input type="text" />'
it 'adds the disabled attribute', ->
$input = $('input').first()
$input.disable()
expect($input).toHaveAttr('disabled', 'disabled')
it 'adds the disabled class', ->
$input = $('input').first()
$input.disable()
expect($input).toHaveClass('disabled')
describe 'enable', ->
beforeEach ->
fixture.set '<input type="text" disabled="disabled" class="disabled" />'
it 'removes the disabled attribute', ->
$input = $('input').first()
$input.enable()
expect($input).not.toHaveAttr('disabled')
it 'removes the disabled class', ->
$input = $('input').first()
$input.enable()
expect($input).not.toHaveClass('disabled')