diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-20 15:07:34 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-20 15:07:34 +0000 |
commit | 8b61452138ecc511b52cd49be4ee6b8a80390c50 (patch) | |
tree | 122b817432c2a0f0e23767bd95791a89b20540c0 /spec/frontend/bootstrap_jquery_spec.js | |
parent | f864f8a7aafa45b0e4c04e4312f89da4b1227c0f (diff) | |
download | gitlab-ce-8b61452138ecc511b52cd49be4ee6b8a80390c50.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/bootstrap_jquery_spec.js')
-rw-r--r-- | spec/frontend/bootstrap_jquery_spec.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/spec/frontend/bootstrap_jquery_spec.js b/spec/frontend/bootstrap_jquery_spec.js new file mode 100644 index 00000000000..d5d592e3839 --- /dev/null +++ b/spec/frontend/bootstrap_jquery_spec.js @@ -0,0 +1,44 @@ +import $ from 'jquery'; +import '~/commons/bootstrap'; + +describe('Bootstrap jQuery extensions', () => { + describe('disable', () => { + beforeEach(() => { + setFixtures('<input type="text" />'); + }); + + it('adds the disabled attribute', () => { + const $input = $('input').first(); + $input.disable(); + + expect($input).toHaveAttr('disabled', 'disabled'); + }); + + it('adds the disabled class', () => { + const $input = $('input').first(); + $input.disable(); + + expect($input).toHaveClass('disabled'); + }); + }); + + describe('enable', () => { + beforeEach(() => { + setFixtures('<input type="text" disabled="disabled" class="disabled" />'); + }); + + it('removes the disabled attribute', () => { + const $input = $('input').first(); + $input.enable(); + + expect($input).not.toHaveAttr('disabled'); + }); + + it('removes the disabled class', () => { + const $input = $('input').first(); + $input.enable(); + + expect($input).not.toHaveClass('disabled'); + }); + }); +}); |