From 1195854aaad61308e7f5339eed54f92284d7666e Mon Sep 17 00:00:00 2001 From: Scott González Date: Wed, 15 Apr 2009 02:33:28 +0000 Subject: Merged in widget-factory branch and added tests. Fixes #4411 - Widget factory should auto detect getters. --- tests/unit/selectable/selectable_methods.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'tests/unit/selectable') 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); $("
").appendTo('body').selectable().selectable("destroy").remove(); ok(true, '.selectable("destroy") called on element'); @@ -51,10 +51,14 @@ test("destroy", function() { $("
").selectable().selectable("destroy").data("foo.selectable", "bar").remove(); ok(true, 'arbitrary option setter after destroy'); + + var expected = $('
').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 = $('
').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 = $('
').selectable(), + actual = expected.selectable('disable'); + equals(actual, expected, 'disable is chainable'); }); })(jQuery); -- cgit v1.2.3