BigW Consortium Gitlab

bootstrap_jquery_spec.js 1.3 KB
Newer Older
1
/* eslint-disable space-before-function-paren, no-var */
Fatih Acet committed
2

3
import '~/commons/bootstrap';
Fatih Acet committed
4 5

(function() {
6
  describe('Bootstrap jQuery extensions', function() {
Fatih Acet committed
7 8
    describe('disable', function() {
      beforeEach(function() {
9
        return setFixtures('<input type="text" />');
Fatih Acet committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
      });
      it('adds the disabled attribute', function() {
        var $input;
        $input = $('input').first();
        $input.disable();
        return expect($input).toHaveAttr('disabled', 'disabled');
      });
      return it('adds the disabled class', function() {
        var $input;
        $input = $('input').first();
        $input.disable();
        return expect($input).toHaveClass('disabled');
      });
    });
    return describe('enable', function() {
      beforeEach(function() {
26
        return setFixtures('<input type="text" disabled="disabled" class="disabled" />');
Fatih Acet committed
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
      });
      it('removes the disabled attribute', function() {
        var $input;
        $input = $('input').first();
        $input.enable();
        return expect($input).not.toHaveAttr('disabled');
      });
      return it('removes the disabled class', function() {
        var $input;
        $input = $('input').first();
        $input.enable();
        return expect($input).not.toHaveClass('disabled');
      });
    });
  });
42
}).call(window);