aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/selectable
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2009-04-15 02:33:28 +0000
committerScott González <scott.gonzalez@gmail.com>2009-04-15 02:33:28 +0000
commit1195854aaad61308e7f5339eed54f92284d7666e (patch)
tree5991992a73f910d897967559332a15bd774816d8 /tests/unit/selectable
parent3c7b61299333d1ec3f4d4d773b1ec4296129a98e (diff)
downloadjquery-ui-1195854aaad61308e7f5339eed54f92284d7666e.tar.gz
jquery-ui-1195854aaad61308e7f5339eed54f92284d7666e.zip
Merged in widget-factory branch and added tests. Fixes #4411 - Widget factory should auto detect getters.
Diffstat (limited to 'tests/unit/selectable')
-rw-r--r--tests/unit/selectable/selectable_methods.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/unit/selectable/selectable_methods.js b/tests/unit/selectable/selectable_methods.js
index 0f52ec7e4..4d1701440 100644
--- a/tests/unit/selectable/selectable_methods.js
+++ b/tests/unit/selectable/selectable_methods.js
@@ -30,7 +30,7 @@ test("init", function() {
});
test("destroy", function() {
- expect(6);
+ expect(7);
$("<div></div>").appendTo('body').selectable().selectable("destroy").remove();
ok(true, '.selectable("destroy") called on element');
@@ -51,10 +51,14 @@ test("destroy", function() {
$("<div></div>").selectable().selectable("destroy").data("foo.selectable", "bar").remove();
ok(true, 'arbitrary option setter after destroy');
+
+ var expected = $('<div></div>').selectable(),
+ actual = expected.selectable('destroy');
+ equals(actual, expected, 'destroy is chainable');
});
test("enable", function() {
- expect(2);
+ expect(3);
var fired = false;
el = $("#selectable1");
@@ -68,10 +72,14 @@ test("enable", function() {
el.simulate("drag", 20, 20);
equals(fired, true, "start fired");
el.selectable("destroy");
+
+ var expected = $('<div></div>').selectable(),
+ actual = expected.selectable('enable');
+ equals(actual, expected, 'enable is chainable');
});
test("disable", function() {
- expect(2);
+ expect(3);
var fired = false;
el = $("#selectable1");
@@ -86,6 +94,10 @@ test("disable", function() {
el.simulate("drag", 20, 20);
equals(fired, false, "start fired");
el.selectable("destroy");
+
+ var expected = $('<div></div>').selectable(),
+ actual = expected.selectable('disable');
+ equals(actual, expected, 'disable is chainable');
});
})(jQuery);