summaryrefslogtreecommitdiff
path: root/spec/javascripts/bootstrap_jquery_spec.js
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2017-03-13 21:48:33 +0000
committerAlfredo Sumaran <alfredo@gitlab.com>2017-03-13 21:48:33 +0000
commit18a688ffdaab6f3908bb7620a226ff770b7ee7ba (patch)
tree3b0f9d9e221755caa71be35a34f2fbc9072ebf0e /spec/javascripts/bootstrap_jquery_spec.js
parent88206d67c38e87685bbacc14cfd60ee9dc42ac7f (diff)
parent29e0cb4b91b3800ef4974c54b8473e6e4fb28e16 (diff)
downloadgitlab-ce-18a688ffdaab6f3908bb7620a226ff770b7ee7ba.tar.gz
Merge branch 'use-corejs-polyfills' into 'master'
Organize our polyfills and standardize on core-js See merge request !9749
Diffstat (limited to 'spec/javascripts/bootstrap_jquery_spec.js')
-rw-r--r--spec/javascripts/bootstrap_jquery_spec.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/spec/javascripts/bootstrap_jquery_spec.js b/spec/javascripts/bootstrap_jquery_spec.js
new file mode 100644
index 00000000000..48994b7c523
--- /dev/null
+++ b/spec/javascripts/bootstrap_jquery_spec.js
@@ -0,0 +1,42 @@
+/* eslint-disable space-before-function-paren, no-var */
+
+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();
+ 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() {
+ return setFixtures('<input type="text" disabled="disabled" class="disabled" />');
+ });
+ 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');
+ });
+ });
+ });
+}).call(window);