aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/sortable
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2012-12-26 08:08:48 -0500
committerMike Sherov <mike.sherov@gmail.com>2012-12-26 08:08:48 -0500
commit0d4022bceb33fb95c41fab768c1829d464861899 (patch)
tree8584929224e413fd6163c4000fe03b6978f969ec /tests/unit/sortable
parent74d7eac2daabce0411e98ed9d59dada551cdd911 (diff)
downloadjquery-ui-0d4022bceb33fb95c41fab768c1829d464861899.tar.gz
jquery-ui-0d4022bceb33fb95c41fab768c1829d464861899.zip
Tests: Convert single quotes to double quotes.
Diffstat (limited to 'tests/unit/sortable')
-rw-r--r--tests/unit/sortable/sortable_events.js126
-rw-r--r--tests/unit/sortable/sortable_methods.js50
2 files changed, 88 insertions, 88 deletions
diff --git a/tests/unit/sortable/sortable_events.js b/tests/unit/sortable/sortable_events.js
index b9ee078f5..1b8165acb 100644
--- a/tests/unit/sortable/sortable_events.js
+++ b/tests/unit/sortable/sortable_events.js
@@ -17,15 +17,15 @@ test("start", function() {
dy: 10
});
- ok(hash, 'start event triggered');
- ok(hash.helper, 'UI hash includes: helper');
- ok(hash.placeholder, 'UI hash includes: placeholder');
- ok(hash.item, 'UI hash includes: item');
- ok(!hash.sender, 'UI hash does not include: sender');
+ ok(hash, "start event triggered");
+ ok(hash.helper, "UI hash includes: helper");
+ ok(hash.placeholder, "UI hash includes: placeholder");
+ ok(hash.item, "UI hash includes: item");
+ ok(!hash.sender, "UI hash does not include: sender");
// todo: see if these events should actually have sane values in them
- ok('position' in hash, 'UI hash includes: position');
- ok('offset' in hash, 'UI hash includes: offset');
+ ok("position" in hash, "UI hash includes: position");
+ ok("offset" in hash, "UI hash includes: offset");
});
@@ -42,13 +42,13 @@ test("sort", function() {
dy: 10
});
- ok(hash, 'sort event triggered');
- ok(hash.helper, 'UI hash includes: helper');
- ok(hash.placeholder, 'UI hash includes: placeholder');
- ok(hash.position && ('top' in hash.position && 'left' in hash.position), 'UI hash includes: position');
- ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset');
- ok(hash.item, 'UI hash includes: item');
- ok(!hash.sender, 'UI hash does not include: sender');
+ ok(hash, "sort event triggered");
+ ok(hash.helper, "UI hash includes: helper");
+ ok(hash.placeholder, "UI hash includes: placeholder");
+ ok(hash.position && ("top" in hash.position && "left" in hash.position), "UI hash includes: position");
+ ok(hash.offset && (hash.offset.top && hash.offset.left), "UI hash includes: offset");
+ ok(hash.item, "UI hash includes: item");
+ ok(!hash.sender, "UI hash does not include: sender");
});
@@ -65,7 +65,7 @@ test("change", function() {
dy: 1
});
- ok(!hash, '1px drag, change event should not be triggered');
+ ok(!hash, "1px drag, change event should not be triggered");
$("#sortable").sortable({
change: function( e, ui ) {
@@ -75,13 +75,13 @@ test("change", function() {
dy: 22
});
- ok(hash, 'change event triggered');
- ok(hash.helper, 'UI hash includes: helper');
- ok(hash.placeholder, 'UI hash includes: placeholder');
- ok(hash.position && ('top' in hash.position && 'left' in hash.position), 'UI hash includes: position');
- ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset');
- ok(hash.item, 'UI hash includes: item');
- ok(!hash.sender, 'UI hash does not include: sender');
+ ok(hash, "change event triggered");
+ ok(hash.helper, "UI hash includes: helper");
+ ok(hash.placeholder, "UI hash includes: placeholder");
+ ok(hash.position && ("top" in hash.position && "left" in hash.position), "UI hash includes: position");
+ ok(hash.offset && (hash.offset.top && hash.offset.left), "UI hash includes: offset");
+ ok(hash.item, "UI hash includes: item");
+ ok(!hash.sender, "UI hash does not include: sender");
});
@@ -97,13 +97,13 @@ test("beforeStop", function() {
dy: 20
});
- ok(hash, 'beforeStop event triggered');
- ok(hash.helper, 'UI hash includes: helper');
- ok(hash.placeholder, 'UI hash includes: placeholder');
- ok(hash.position && ('top' in hash.position && 'left' in hash.position), 'UI hash includes: position');
- ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset');
- ok(hash.item, 'UI hash includes: item');
- ok(!hash.sender, 'UI hash does not include: sender');
+ ok(hash, "beforeStop event triggered");
+ ok(hash.helper, "UI hash includes: helper");
+ ok(hash.placeholder, "UI hash includes: placeholder");
+ ok(hash.position && ("top" in hash.position && "left" in hash.position), "UI hash includes: position");
+ ok(hash.offset && (hash.offset.top && hash.offset.left), "UI hash includes: offset");
+ ok(hash.item, "UI hash includes: item");
+ ok(!hash.sender, "UI hash does not include: sender");
});
@@ -119,13 +119,13 @@ test("stop", function() {
dy: 20
});
- ok(hash, 'stop event triggered');
- ok(!hash.helper, 'UI should not include: helper');
- ok(hash.placeholder, 'UI hash includes: placeholder');
- ok(hash.position && ('top' in hash.position && 'left' in hash.position), 'UI hash includes: position');
- ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset');
- ok(hash.item, 'UI hash includes: item');
- ok(!hash.sender, 'UI hash does not include: sender');
+ ok(hash, "stop event triggered");
+ ok(!hash.helper, "UI should not include: helper");
+ ok(hash.placeholder, "UI hash includes: placeholder");
+ ok(hash.position && ("top" in hash.position && "left" in hash.position), "UI hash includes: position");
+ ok(hash.offset && (hash.offset.top && hash.offset.left), "UI hash includes: offset");
+ ok(hash.item, "UI hash includes: item");
+ ok(!hash.sender, "UI hash does not include: sender");
});
@@ -142,7 +142,7 @@ test("update", function() {
dy: 1
});
- ok(!hash, '1px drag, update event should not be triggered');
+ ok(!hash, "1px drag, update event should not be triggered");
$("#sortable").sortable({
update: function( e, ui ) {
@@ -152,13 +152,13 @@ test("update", function() {
dy: 22
});
- ok(hash, 'update event triggered');
- ok(!hash.helper, 'UI hash should not include: helper');
- ok(hash.placeholder, 'UI hash includes: placeholder');
- ok(hash.position && ('top' in hash.position && 'left' in hash.position), 'UI hash includes: position');
- ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset');
- ok(hash.item, 'UI hash includes: item');
- ok(!hash.sender, 'UI hash does not include: sender');
+ ok(hash, "update event triggered");
+ ok(!hash.helper, "UI hash should not include: helper");
+ ok(hash.placeholder, "UI hash includes: placeholder");
+ ok(hash.position && ("top" in hash.position && "left" in hash.position), "UI hash includes: position");
+ ok(hash.offset && (hash.offset.top && hash.offset.left), "UI hash includes: offset");
+ ok(hash.item, "UI hash includes: item");
+ ok(!hash.sender, "UI hash does not include: sender");
});
@@ -172,21 +172,21 @@ test("#3019: Stop fires too early", function() {
}
});
- TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, 'Dragging the sortable');
+ TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, "Dragging the sortable");
equal(helper, null, "helper should be false");
});
-test('#4752: link event firing on sortable with connect list', function () {
+test("#4752: link event firing on sortable with connect list", function () {
expect( 10 );
var fired = {},
hasFired = function (type) { return (type in fired) && (true === fired[type]); };
- $('#sortable').clone().attr('id', 'sortable2').insertAfter('#sortable');
+ $("#sortable").clone().attr("id", "sortable2").insertAfter("#sortable");
- $('#qunit-fixture ul').sortable({
- connectWith: '#qunit-fixture ul',
+ $("#qunit-fixture ul").sortable({
+ connectWith: "#qunit-fixture ul",
change: function () {
fired.change = true;
},
@@ -198,29 +198,29 @@ test('#4752: link event firing on sortable with connect list', function () {
}
});
- $('#qunit-fixture ul').bind('click.ui-sortable-test', function () {
+ $("#qunit-fixture ul").bind("click.ui-sortable-test", function () {
fired.click = true;
});
- $('#sortable li:eq(0)').simulate('click');
- ok(!hasFired('change'), 'Click only, change event should not have fired');
- ok(hasFired('click'), 'Click event should have fired');
+ $("#sortable li:eq(0)").simulate("click");
+ ok(!hasFired("change"), "Click only, change event should not have fired");
+ ok(hasFired("click"), "Click event should have fired");
// Drag an item within the first list
fired = {};
- $('#sortable li:eq(0)').simulate('drag', { dx: 0, dy: 40 });
- ok(hasFired('change'), '40px drag, change event should have fired');
- ok(!hasFired('receive'), 'Receive event should not have fired');
- ok(!hasFired('remove'), 'Remove event should not have fired');
- ok(!hasFired('click'), 'Click event should not have fired');
+ $("#sortable li:eq(0)").simulate("drag", { dx: 0, dy: 40 });
+ ok(hasFired("change"), "40px drag, change event should have fired");
+ ok(!hasFired("receive"), "Receive event should not have fired");
+ ok(!hasFired("remove"), "Remove event should not have fired");
+ ok(!hasFired("click"), "Click event should not have fired");
// Drag an item from the first list to the second, connected list
fired = {};
- $('#sortable li:eq(0)').simulate('drag', { dx: 0, dy: 150 });
- ok(hasFired('change'), '150px drag, change event should have fired');
- ok(hasFired('receive'), 'Receive event should have fired');
- ok(hasFired('remove'), 'Remove event should have fired');
- ok(!hasFired('click'), 'Click event should not have fired');
+ $("#sortable li:eq(0)").simulate("drag", { dx: 0, dy: 150 });
+ ok(hasFired("change"), "150px drag, change event should have fired");
+ ok(hasFired("receive"), "Receive event should have fired");
+ ok(hasFired("remove"), "Remove event should have fired");
+ ok(!hasFired("click"), "Click event should not have fired");
});
/*
diff --git a/tests/unit/sortable/sortable_methods.js b/tests/unit/sortable/sortable_methods.js
index de32e2f5d..07a7bc77d 100644
--- a/tests/unit/sortable/sortable_methods.js
+++ b/tests/unit/sortable/sortable_methods.js
@@ -8,36 +8,36 @@ module("sortable: methods");
test("init", function() {
expect(5);
- $("<div></div>").appendTo('body').sortable().remove();
- ok(true, '.sortable() called on element');
+ $("<div></div>").appendTo("body").sortable().remove();
+ ok(true, ".sortable() called on element");
$([]).sortable();
- ok(true, '.sortable() called on empty collection');
+ ok(true, ".sortable() called on empty collection");
$("<div></div>").sortable();
- ok(true, '.sortable() called on disconnected DOMElement');
+ ok(true, ".sortable() called on disconnected DOMElement");
$("<div></div>").sortable().sortable("option", "foo");
- ok(true, 'arbitrary option getter after init');
+ ok(true, "arbitrary option getter after init");
$("<div></div>").sortable().sortable("option", "foo", "bar");
- ok(true, 'arbitrary option setter after init');
+ ok(true, "arbitrary option setter after init");
});
test("destroy", function() {
expect(4);
- $("<div></div>").appendTo('body').sortable().sortable("destroy").remove();
- ok(true, '.sortable("destroy") called on element');
+ $("<div></div>").appendTo("body").sortable().sortable("destroy").remove();
+ ok(true, ".sortable('destroy') called on element");
$([]).sortable().sortable("destroy");
- ok(true, '.sortable("destroy") called on empty collection');
+ ok(true, ".sortable('destroy') called on empty collection");
$("<div></div>").sortable().sortable("destroy");
- ok(true, '.sortable("destroy") called on disconnected DOMElement');
+ ok(true, ".sortable('destroy') called on disconnected DOMElement");
- var expected = $('<div></div>').sortable(),
- actual = expected.sortable('destroy');
- equal(actual, expected, 'destroy is chainable');
+ var expected = $("<div></div>").sortable(),
+ actual = expected.sortable("destroy");
+ equal(actual, expected, "destroy is chainable");
});
test("enable", function() {
@@ -47,7 +47,7 @@ test("enable", function() {
el = $("#sortable").sortable({ disabled: true });
- TestHelpers.sortable.sort($("li", el)[0], 0, 44, 0, '.sortable({ disabled: true })');
+ TestHelpers.sortable.sort($("li", el)[0], 0, 44, 0, ".sortable({ disabled: true })");
el.sortable("enable");
equal(el.sortable("option", "disabled"), false, "disabled option getter");
@@ -57,11 +57,11 @@ test("enable", function() {
el.sortable("option", "disabled", false);
equal(el.sortable("option", "disabled"), false, "disabled option setter");
- TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, '.sortable("option", "disabled", false)');
+ TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, ".sortable('option', 'disabled', false)");
- expected = $('<div></div>').sortable(),
- actual = expected.sortable('enable');
- equal(actual, expected, 'enable is chainable');
+ expected = $("<div></div>").sortable(),
+ actual = expected.sortable("enable");
+ equal(actual, expected, "enable is chainable");
});
test("disable", function() {
@@ -70,23 +70,23 @@ test("disable", function() {
var el, actual, expected;
el = $("#sortable").sortable({ disabled: false });
- TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, '.sortable({ disabled: false })');
+ TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, ".sortable({ disabled: false })");
el.sortable("disable");
- TestHelpers.sortable.sort($("li", el)[0], 0, 44, 0, 'disabled.sortable getter');
+ TestHelpers.sortable.sort($("li", el)[0], 0, 44, 0, "disabled.sortable getter");
el.sortable("destroy");
el.sortable({ disabled: false });
- TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, '.sortable({ disabled: false })');
+ TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, ".sortable({ disabled: false })");
el.sortable("option", "disabled", true);
equal(el.sortable("option", "disabled"), true, "disabled option setter");
ok(el.sortable("widget").is(":not(.ui-state-disabled)"), "sortable element does not get ui-state-disabled since it's an interaction");
- TestHelpers.sortable.sort($("li", el)[0], 0, 44, 0, '.sortable("option", "disabled", true)');
+ TestHelpers.sortable.sort($("li", el)[0], 0, 44, 0, ".sortable('option', 'disabled', true)");
- expected = $('<div></div>').sortable(),
- actual = expected.sortable('disable');
- equal(actual, expected, 'disable is chainable');
+ expected = $("<div></div>").sortable(),
+ actual = expected.sortable("disable");
+ equal(actual, expected, "disable is chainable");
});
})(jQuery);