aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/slider
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2009-02-02 07:13:25 +0000
committerRichard Worth <rdworth@gmail.com>2009-02-02 07:13:25 +0000
commit60b7c7e0f1eea663cd264e0de75a50c645b89c11 (patch)
tree98baf4fe314837edc98d9bb3fdd6d1270e2a4135 /tests/unit/slider
parenta5f6558a1d784b25c6563e85c673ee5dcf2b810d (diff)
downloadjquery-ui-60b7c7e0f1eea663cd264e0de75a50c645b89c11.tar.gz
jquery-ui-60b7c7e0f1eea663cd264e0de75a50c645b89c11.zip
slider unit tests: moved init and destroy tests to 'slider: methods' module
Diffstat (limited to 'tests/unit/slider')
-rw-r--r--tests/unit/slider/slider_core.js56
-rw-r--r--tests/unit/slider/slider_methods.js64
2 files changed, 60 insertions, 60 deletions
diff --git a/tests/unit/slider/slider_core.js b/tests/unit/slider/slider_core.js
index d2221fa01..0aadc913d 100644
--- a/tests/unit/slider/slider_core.js
+++ b/tests/unit/slider/slider_core.js
@@ -15,62 +15,6 @@ function handle() {
// Slider Tests
module("slider: core");
-test("init", function() {
- expect(6);
-
- $("<div></div>").appendTo('body').slider().remove();
- ok(true, '.slider() called on element');
-
- $([]).slider().remove();
- ok(true, '.slider() called on empty collection');
-
- $('<div></div>').slider().remove();
- ok(true, '.slider() called on disconnected DOMElement');
-
- $('<div></div>').slider().slider("foo").remove();
- ok(true, 'arbitrary method called after init');
-
- el = $('<div></div>').slider();
- var foo = el.data("foo.slider");
- el.remove();
- ok(true, 'arbitrary option getter after init');
-
- $('<div></div>').slider().data("foo.slider", "bar").remove();
- ok(true, 'arbitrary option setter after init');
-});
-
-test("destroy", function() {
- expect(8);
-
- $("<div></div>").appendTo('body').slider().slider("destroy").remove();
- ok(true, '.slider("destroy") called on element');
-
- $([]).slider().slider("destroy").remove();
- ok(true, '.slider("destroy") called on empty collection');
-
- $('<div></div>').appendTo('body').remove().slider().slider("destroy").remove();
- ok(true, '.slider("destroy") called on disconnected DOMElement');
-
- $('<div></div>').slider().slider("destroy").slider("foo").remove();
- ok(true, 'arbitrary method called after destroy');
-
- el = $('<div></div>').slider();
- var foo = el.slider("destroy").data("foo.slider");
- el.remove();
- ok(true, 'arbitrary option getter (.data) after destroy');
-
- el = $('<div></div>').slider();
- var foo = el.slider("destroy").slider("option", "foo");
- el.remove();
- ok(true, 'arbitrary option getter (.slider option method) after destroy');
-
- $('<div></div>').slider().slider("destroy").data("foo.slider", "bar").remove();
- ok(true, 'arbitrary option setter (.data) after destroy');
-
- $('<div></div>').slider().slider("destroy").slider("options", "foo", "bar").remove();
- ok(true, 'arbitrary option setter (.slider option method) after destroy');
-});
-
test("keydown HOME on handle sets value to min", function() {
el = $('<div></div>');
options = {
diff --git a/tests/unit/slider/slider_methods.js b/tests/unit/slider/slider_methods.js
index 6c966a248..05b8905b1 100644
--- a/tests/unit/slider/slider_methods.js
+++ b/tests/unit/slider/slider_methods.js
@@ -5,12 +5,60 @@
module("slider: methods");
-test("value", function() {
- ok(false, "missing test - untested code is broken code.");
+test("init", function() {
+ expect(6);
+
+ $("<div></div>").appendTo('body').slider().remove();
+ ok(true, '.slider() called on element');
+
+ $([]).slider().remove();
+ ok(true, '.slider() called on empty collection');
+
+ $('<div></div>').slider().remove();
+ ok(true, '.slider() called on disconnected DOMElement');
+
+ $('<div></div>').slider().slider("foo").remove();
+ ok(true, 'arbitrary method called after init');
+
+ el = $('<div></div>').slider();
+ var foo = el.data("foo.slider");
+ el.remove();
+ ok(true, 'arbitrary option getter after init');
+
+ $('<div></div>').slider().data("foo.slider", "bar").remove();
+ ok(true, 'arbitrary option setter after init');
});
-test("values", function() {
- ok(false, "missing test - untested code is broken code.");
+test("destroy", function() {
+ expect(8);
+
+ $("<div></div>").appendTo('body').slider().slider("destroy").remove();
+ ok(true, '.slider("destroy") called on element');
+
+ $([]).slider().slider("destroy").remove();
+ ok(true, '.slider("destroy") called on empty collection');
+
+ $('<div></div>').appendTo('body').remove().slider().slider("destroy").remove();
+ ok(true, '.slider("destroy") called on disconnected DOMElement');
+
+ $('<div></div>').slider().slider("destroy").slider("foo").remove();
+ ok(true, 'arbitrary method called after destroy');
+
+ el = $('<div></div>').slider();
+ var foo = el.slider("destroy").data("foo.slider");
+ el.remove();
+ ok(true, 'arbitrary option getter (.data) after destroy');
+
+ el = $('<div></div>').slider();
+ var foo = el.slider("destroy").slider("option", "foo");
+ el.remove();
+ ok(true, 'arbitrary option getter (.slider option method) after destroy');
+
+ $('<div></div>').slider().slider("destroy").data("foo.slider", "bar").remove();
+ ok(true, 'arbitrary option setter (.data) after destroy');
+
+ $('<div></div>').slider().slider("destroy").slider("options", "foo", "bar").remove();
+ ok(true, 'arbitrary option setter (.slider option method) after destroy');
});
test("enable", function() {
@@ -21,4 +69,12 @@ test("disable", function() {
ok(false, "missing test - untested code is broken code.");
});
+test("value", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("values", function() {
+ ok(false, "missing test - untested code is broken code.");
+});
+
})(jQuery);