aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/slider
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-04-18 22:46:39 -0400
committerScott González <scott.gonzalez@gmail.com>2012-04-18 22:46:39 -0400
commita0fb2c227e66c7b034726943a96360829a5ad3b2 (patch)
treecc5b3ab35eddae14aff621bd7b5c5c0659a4b50e /tests/unit/slider
parenta28983086ee91b19200c47fadc6bc3ba58a0fcb9 (diff)
downloadjquery-ui-a0fb2c227e66c7b034726943a96360829a5ad3b2.tar.gz
jquery-ui-a0fb2c227e66c7b034726943a96360829a5ad3b2.zip
Tests: Lint.
Diffstat (limited to 'tests/unit/slider')
-rw-r--r--tests/unit/slider/slider_methods.js14
-rw-r--r--tests/unit/slider/slider_options.js10
2 files changed, 13 insertions, 11 deletions
diff --git a/tests/unit/slider/slider_methods.js b/tests/unit/slider/slider_methods.js
index b46222002..79f80e868 100644
--- a/tests/unit/slider/slider_methods.js
+++ b/tests/unit/slider/slider_methods.js
@@ -17,8 +17,8 @@ test("init", function() {
$('<div></div>').slider().remove();
ok(true, '.slider() called on disconnected DOMElement');
- var el = $('<div></div>').slider();
- var foo = el.slider("option", "foo");
+ var el = $('<div></div>').slider(),
+ foo = el.slider("option", "foo");
el.remove();
ok(true, 'arbitrary option getter after init');
@@ -42,11 +42,12 @@ test("destroy", function() {
});
test("enable", function() {
- var expected = $('<div></div>').slider(),
+ var el,
+ expected = $('<div></div>').slider(),
actual = expected.slider('enable');
equal(actual, expected, 'enable is chainable');
- var el = $('<div></div>').slider({ disabled: true });
+ el = $('<div></div>').slider({ disabled: true });
ok(el.hasClass('ui-disabled'), 'slider has ui-disabled class before enable method call');
ok(el.hasClass('ui-slider-disabled'), 'slider has ui-slider-disabled class before enable method call');
el.slider('enable');
@@ -55,11 +56,12 @@ test("enable", function() {
});
test("disable", function() {
- var expected = $('<div></div>').slider(),
+ var el,
+ expected = $('<div></div>').slider(),
actual = expected.slider('disable');
equal(actual, expected, 'disable is chainable');
- var el = $('<div></div>').slider({ disabled: false });
+ el = $('<div></div>').slider({ disabled: false });
ok(!el.hasClass('ui-disabled'), 'slider does not have ui-disabled class before disabled method call');
ok(!el.hasClass('ui-slider-disabled'), 'slider does not have ui-slider-disabled class before disable method call');
el.slider('disable');
diff --git a/tests/unit/slider/slider_options.js b/tests/unit/slider/slider_options.js
index 7d9899284..09067a3e9 100644
--- a/tests/unit/slider/slider_options.js
+++ b/tests/unit/slider/slider_options.js
@@ -23,8 +23,8 @@ test("max", function() {
};
el.slider(options);
- ok(el.slider("option", "value") == options.value, "value option is not contained by max");
- ok(el.slider("value") == options.max, "value method is contained by max");
+ ok(el.slider("option", "value") === options.value, "value option is not contained by max");
+ ok(el.slider("value") === options.max, "value method is contained by max");
el.slider('destroy');
});
@@ -41,8 +41,8 @@ test("min", function() {
};
el.slider(options);
- ok(el.slider("option", "value") == options.value, "value option is not contained by min");
- ok(el.slider("value") == options.min, "value method is contained by min");
+ ok(el.slider("option", "value") === options.value, "value option is not contained by min");
+ ok(el.slider("value") === options.min, "value method is contained by min");
el.slider('destroy');
});
@@ -73,7 +73,7 @@ test("orientation", function() {
value: -1
};
- var percentVal = (options.value - options.min) / (options.max - options.min) * 100;
+ percentVal = (options.value - options.min) / (options.max - options.min) * 100;
el.slider(options).slider("option", "orientation", "vertical");
ok(el.is('.ui-slider-vertical'), "vertical slider has class .ui-slider-vertical");