aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/selectable/selectable_options.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/selectable/selectable_options.js')
-rw-r--r--tests/unit/selectable/selectable_options.js25
1 files changed, 15 insertions, 10 deletions
diff --git a/tests/unit/selectable/selectable_options.js b/tests/unit/selectable/selectable_options.js
index ad57000a9..2b7fc1648 100644
--- a/tests/unit/selectable/selectable_options.js
+++ b/tests/unit/selectable/selectable_options.js
@@ -7,13 +7,15 @@ module("selectable: options");
test("autoRefresh", function() {
expect(3);
- el = $("#selectable1");
- var actual, sel = $("*", el), selected = function() { actual += 1; };
- actual = 0;
+ var actual = 0,
+ el = $("#selectable1"),
+ sel = $("*", el),
+ selected = function() { actual += 1; };
+
el = $("#selectable1").selectable({ autoRefresh: false, selected: selected });
sel.hide();
- TestHelpers.selectableDrag(1000, 1000);
+ TestHelpers.selectable.drag(el, 1000, 1000);
equal(actual, sel.length);
el.selectable("destroy");
@@ -21,10 +23,10 @@ test("autoRefresh", function() {
sel.show();
el = $("#selectable1").selectable({ autoRefresh: true, selected: selected });
sel.hide();
- TestHelpers.selectableDrag(1000, 1000);
+ TestHelpers.selectable.drag(el, 1000, 1000);
equal(actual, 0);
sel.show();
- TestHelpers.selectableDrag(1000, 1000);
+ TestHelpers.selectable.drag(el, 1000, 1000);
equal(actual, sel.length);
el.selectable("destroy");
sel.show();
@@ -32,12 +34,15 @@ test("autoRefresh", function() {
test("filter", function() {
expect(2);
- el = $("#selectable1");
- var actual, sel = $("*", el), selected = function() { actual += 1; };
- actual = 0;
+ var actual =0,
+ el = $("#selectable1"),
+ sel = $("*", el),
+ selected = function() { actual += 1; };
+
+
el = $("#selectable1").selectable({ filter: '.special', selected: selected });
- TestHelpers.selectableDrag(1000, 1000);
+ TestHelpers.selectable.drag(el, 1000, 1000);
ok(sel.length !== 1, "this test assumes more than 1 selectee");
equal(actual, 1);
el.selectable("destroy");