summaryrefslogtreecommitdiff
path: root/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_methods.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_methods.js')
-rw-r--r--src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_methods.js64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_methods.js
new file mode 100644
index 0000000..6ac287f
--- /dev/null
+++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_methods.js
@@ -0,0 +1,64 @@
+/*
+ * resizable_methods.js
+ */
+(function($) {
+
+module("resizable: methods");
+
+test("init", function() {
+ expect(6);
+
+ $("<div></div>").appendTo('body').resizable().remove();
+ ok(true, '.resizable() called on element');
+
+ $([]).resizable().remove();
+ ok(true, '.resizable() called on empty collection');
+
+ $('<div></div>').resizable().remove();
+ ok(true, '.resizable() called on disconnected DOMElement');
+
+ $('<div></div>').resizable().resizable("foo").remove();
+ ok(true, 'arbitrary method called after init');
+
+ el = $('<div></div>').resizable()
+ var foo = el.resizable("option", "foo");
+ el.remove();
+ ok(true, 'arbitrary option getter after init');
+
+ $('<div></div>').resizable().resizable("option", "foo", "bar").remove();
+ ok(true, 'arbitrary option setter after init');
+});
+
+test("destroy", function() {
+ $("<div></div>").appendTo('body').resizable().resizable("destroy").remove();
+ ok(true, '.resizable("destroy") called on element');
+
+ $([]).resizable().resizable("destroy").remove();
+ ok(true, '.resizable("destroy") called on empty collection');
+
+ $('<div></div>').resizable().resizable("destroy").remove();
+ ok(true, '.resizable("destroy") called on disconnected DOMElement');
+
+ $('<div></div>').resizable().resizable("destroy").resizable("foo").remove();
+ ok(true, 'arbitrary method called after destroy');
+
+ var expected = $('<div></div>').resizable(),
+ actual = expected.resizable('destroy');
+ equals(actual, expected, 'destroy is chainable');
+});
+
+test("enable", function() {
+ var expected = $('<div></div>').resizable(),
+ actual = expected.resizable('enable');
+ equals(actual, expected, 'enable is chainable');
+ ok(false, "missing test - untested code is broken code.");
+});
+
+test("disable", function() {
+ var expected = $('<div></div>').resizable(),
+ actual = expected.resizable('disable');
+ equals(actual, expected, 'disable is chainable');
+ ok(false, "missing test - untested code is broken code.");
+});
+
+})(jQuery);