summaryrefslogtreecommitdiff
path: root/spec/javascripts/extensions/jquery_spec.js
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-07-22 17:01:57 +0300
committerFatih Acet <acetfatih@gmail.com>2016-07-22 17:07:29 +0300
commitbc3f33f92a16d3afdb8a472f60940e7c46a31564 (patch)
treec6e568504b7888591ad15586bb1ace99db8941ca /spec/javascripts/extensions/jquery_spec.js
parent033e5423a2594e08a7ebcd2379bd2331f4c39032 (diff)
downloadgitlab-ce-jsify.tar.gz
JSify all the things!jsify
Diffstat (limited to 'spec/javascripts/extensions/jquery_spec.js')
-rw-r--r--spec/javascripts/extensions/jquery_spec.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/spec/javascripts/extensions/jquery_spec.js b/spec/javascripts/extensions/jquery_spec.js
new file mode 100644
index 00000000000..87581f24031
--- /dev/null
+++ b/spec/javascripts/extensions/jquery_spec.js
@@ -0,0 +1,38 @@
+
+/*= require extensions/jquery */
+describe('jQuery extensions', function() {
+ describe('disable', function() {
+ beforeEach(function() {
+ return fixture.set('<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 fixture.set('<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');
+ });
+ });
+});