diff options
Diffstat (limited to 'spec/javascripts/bootstrap_jquery_spec.js')
-rw-r--r-- | spec/javascripts/bootstrap_jquery_spec.js | 80 |
1 files changed, 39 insertions, 41 deletions
diff --git a/spec/javascripts/bootstrap_jquery_spec.js b/spec/javascripts/bootstrap_jquery_spec.js index 3e2d814a06a..35340a3bc42 100644 --- a/spec/javascripts/bootstrap_jquery_spec.js +++ b/spec/javascripts/bootstrap_jquery_spec.js @@ -3,47 +3,45 @@ import $ from 'jquery'; import '~/commons/bootstrap'; -(function() { - describe('Bootstrap jQuery extensions', function() { - describe('disable', function() { - beforeEach(function() { - return setFixtures('<input type="text" />'); - }); - - it('adds the disabled attribute', function() { - var $input; - $input = $('input').first(); - $input.disable(); - - expect($input).toHaveAttr('disabled', 'disabled'); - }); - return it('adds the disabled class', function() { - var $input; - $input = $('input').first(); - $input.disable(); - - expect($input).toHaveClass('disabled'); - }); +describe('Bootstrap jQuery extensions', function() { + describe('disable', function() { + beforeEach(function() { + return setFixtures('<input type="text" />'); }); - return describe('enable', function() { - beforeEach(function() { - return setFixtures('<input type="text" disabled="disabled" class="disabled" />'); - }); - - it('removes the disabled attribute', function() { - var $input; - $input = $('input').first(); - $input.enable(); - - expect($input).not.toHaveAttr('disabled'); - }); - return it('removes the disabled class', function() { - var $input; - $input = $('input').first(); - $input.enable(); - - expect($input).not.toHaveClass('disabled'); - }); + + it('adds the disabled attribute', function() { + var $input; + $input = $('input').first(); + $input.disable(); + + expect($input).toHaveAttr('disabled', 'disabled'); + }); + return it('adds the disabled class', function() { + var $input; + $input = $('input').first(); + $input.disable(); + + expect($input).toHaveClass('disabled'); + }); + }); + return describe('enable', function() { + beforeEach(function() { + return setFixtures('<input type="text" disabled="disabled" class="disabled" />'); + }); + + it('removes the disabled attribute', function() { + var $input; + $input = $('input').first(); + $input.enable(); + + expect($input).not.toHaveAttr('disabled'); + }); + return it('removes the disabled class', function() { + var $input; + $input = $('input').first(); + $input.enable(); + + expect($input).not.toHaveClass('disabled'); }); }); -}).call(window); +}); |