aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/resizable
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2012-10-23 09:36:42 -0500
committerCorey Frang <gnarf@gnarf.net>2012-10-23 09:37:46 -0500
commite1230997aa14dae6f35326c8ba20bfe2428507c2 (patch)
treef00984f5fbbf12f175c0994c497513a2d8e8ee26 /tests/unit/resizable
parent7af1ec727bcca8367e804cea77b9dd238b1c0d69 (diff)
downloadjquery-ui-e1230997aa14dae6f35326c8ba20bfe2428507c2.tar.gz
jquery-ui-e1230997aa14dae6f35326c8ba20bfe2428507c2.zip
Build: Enable "unused" option in jshint - Remove unused variables from codebase. - Closes gh-788
Squashed commit of the following: commit 7f19f92c646f180bc067bb24123175251a64a9d6 Author: Mike Sherov <mike.sherov@gmail.com> Date: Tue Oct 23 10:34:28 2012 -0400 put back in fake args for signatures that we want to keep commit 257505a9e69da0c53e3a989dab87a13112045a29 Author: Mike Sherov <mike.sherov@gmail.com> Date: Tue Oct 23 08:10:20 2012 -0400 changes per @scott_gonzalez commit 12725480cb58e70865e5aa6e735009b6b035c8f3 Author: Mike Sherov <mike.sherov@gmail.com> Date: Mon Oct 22 22:54:05 2012 -0400 clean up unused vars in ui directory commit 563595e7aee5d4a5c096b2d1de655abdf920aacd Author: Mike Sherov <mike.sherov@gmail.com> Date: Mon Oct 22 22:37:42 2012 -0400 clean up unused vars in grunt and tests
Diffstat (limited to 'tests/unit/resizable')
-rw-r--r--tests/unit/resizable/resizable_core.js36
-rw-r--r--tests/unit/resizable/resizable_events.js4
-rw-r--r--tests/unit/resizable/resizable_methods.js3
-rw-r--r--tests/unit/resizable/resizable_options.js52
4 files changed, 50 insertions, 45 deletions
diff --git a/tests/unit/resizable/resizable_core.js b/tests/unit/resizable/resizable_core.js
index aef2ae15c..8cc6cec82 100644
--- a/tests/unit/resizable/resizable_core.js
+++ b/tests/unit/resizable/resizable_core.js
@@ -2,9 +2,7 @@
* resizable_core.js
*/
-var el;
-
-var drag = function(el, dx, dy, complete) {
+TestHelpers.resizableDrag = function(el, dx, dy, complete) {
// speed = sync -> Drag syncrhonously.
// speed = fast|slow -> Drag asyncrhonously - animated.
@@ -46,10 +44,10 @@ test("n", function() {
var handle = '.ui-resizable-n', target = $('#resizable1').resizable({ handles: 'all' });
- drag(handle, 0, -50);
+ TestHelpers.resizableDrag(handle, 0, -50);
equal( target.height(), 150, "compare height" );
- drag(handle, 0, 50);
+ TestHelpers.resizableDrag(handle, 0, 50);
equal( target.height(), 100, "compare height" );
});
@@ -58,10 +56,10 @@ test("s", function() {
var handle = '.ui-resizable-s', target = $('#resizable1').resizable({ handles: 'all' });
- drag(handle, 0, 50);
+ TestHelpers.resizableDrag(handle, 0, 50);
equal( target.height(), 150, "compare height" );
- drag(handle, 0, -50);
+ TestHelpers.resizableDrag(handle, 0, -50);
equal( target.height(), 100, "compare height" );
});
@@ -70,10 +68,10 @@ test("e", function() {
var handle = '.ui-resizable-e', target = $('#resizable1').resizable({ handles: 'all' });
- drag(handle, 50);
+ TestHelpers.resizableDrag(handle, 50);
equal( target.width(), 150, "compare width");
- drag(handle, -50);
+ TestHelpers.resizableDrag(handle, -50);
equal( target.width(), 100, "compare width" );
});
@@ -82,10 +80,10 @@ test("w", function() {
var handle = '.ui-resizable-w', target = $('#resizable1').resizable({ handles: 'all' });
- drag(handle, -50);
+ TestHelpers.resizableDrag(handle, -50);
equal( target.width(), 150, "compare width" );
- drag(handle, 50);
+ TestHelpers.resizableDrag(handle, 50);
equal( target.width(), 100, "compare width" );
});
@@ -94,11 +92,11 @@ test("ne", function() {
var handle = '.ui-resizable-ne', target = $('#resizable1').css({ overflow: 'hidden' }).resizable({ handles: 'all' });
- drag(handle, -50, -50);
+ TestHelpers.resizableDrag(handle, -50, -50);
equal( target.width(), 50, "compare width" );
equal( target.height(), 150, "compare height" );
- drag(handle, 50, 50);
+ TestHelpers.resizableDrag(handle, 50, 50);
equal( target.width(), 100, "compare width" );
equal( target.height(), 100, "compare height" );
});
@@ -108,11 +106,11 @@ test("se", function() {
var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all' });
- drag(handle, 50, 50);
+ TestHelpers.resizableDrag(handle, 50, 50);
equal( target.width(), 150, "compare width" );
equal( target.height(), 150, "compare height" );
- drag(handle, -50, -50);
+ TestHelpers.resizableDrag(handle, -50, -50);
equal( target.width(), 100, "compare width" );
equal( target.height(), 100, "compare height" );
});
@@ -122,11 +120,11 @@ test("sw", function() {
var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ handles: 'all' });
- drag(handle, -50, -50);
+ TestHelpers.resizableDrag(handle, -50, -50);
equal( target.width(), 150, "compare width" );
equal( target.height(), 50, "compare height" );
- drag(handle, 50, 50);
+ TestHelpers.resizableDrag(handle, 50, 50);
equal( target.width(), 100, "compare width" );
equal( target.height(), 100, "compare height" );
});
@@ -136,11 +134,11 @@ test("nw", function() {
var handle = '.ui-resizable-nw', target = $('#resizable1').resizable({ handles: 'all' });
- drag(handle, -50, -50);
+ TestHelpers.resizableDrag(handle, -50, -50);
equal( target.width(), 150, "compare width" );
equal( target.height(), 150, "compare height" );
- drag(handle, 50, 50);
+ TestHelpers.resizableDrag(handle, 50, 50);
equal( target.width(), 100, "compare width" );
equal( target.height(), 100, "compare height" );
});
diff --git a/tests/unit/resizable/resizable_events.js b/tests/unit/resizable/resizable_events.js
index 52d55731c..d7793ff2f 100644
--- a/tests/unit/resizable/resizable_events.js
+++ b/tests/unit/resizable/resizable_events.js
@@ -5,4 +5,8 @@
module("resizable: events");
+// this is here to make JSHint pass "unused", and we don't want to
+// remove the parameter for when we finally implement
+$.noop();
+
})(jQuery);
diff --git a/tests/unit/resizable/resizable_methods.js b/tests/unit/resizable/resizable_methods.js
index 87859acf7..b12f3035a 100644
--- a/tests/unit/resizable/resizable_methods.js
+++ b/tests/unit/resizable/resizable_methods.js
@@ -5,5 +5,8 @@
module("resizable: methods");
+// this is here to make JSHint pass "unused", and we don't want to
+// remove the parameter for when we finally implement
+$.noop();
})(jQuery);
diff --git a/tests/unit/resizable/resizable_options.js b/tests/unit/resizable/resizable_options.js
index e10a55a31..c17f329fd 100644
--- a/tests/unit/resizable/resizable_options.js
+++ b/tests/unit/resizable/resizable_options.js
@@ -10,11 +10,11 @@ test("aspectRatio: 'preserve' (e)", function() {
var handle = '.ui-resizable-e', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
- drag(handle, 80);
+ TestHelpers.resizableDrag(handle, 80);
equal( target.width(), 130, "compare maxWidth");
equal( target.height(), 130, "compare maxHeight");
- drag(handle, -130);
+ TestHelpers.resizableDrag(handle, -130);
equal( target.width(), 70, "compare minWidth");
equal( target.height(), 70, "compare minHeight");
});
@@ -24,11 +24,11 @@ test("aspectRatio: 'preserve' (w)", function() {
var handle = '.ui-resizable-w', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
- drag(handle, -80);
+ TestHelpers.resizableDrag(handle, -80);
equal( target.width(), 130, "compare maxWidth");
equal( target.height(), 130, "compare maxHeight");
- drag(handle, 130);
+ TestHelpers.resizableDrag(handle, 130);
equal( target.width(), 70, "compare minWidth");
equal( target.height(), 70, "compare minHeight");
});
@@ -38,11 +38,11 @@ test("aspectRatio: 'preserve' (n)", function() {
var handle = '.ui-resizable-n', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
- drag(handle, 0, -80);
+ TestHelpers.resizableDrag(handle, 0, -80);
equal( target.width(), 130, "compare maxWidth");
equal( target.height(), 130, "compare maxHeight");
- drag(handle, 0, 80);
+ TestHelpers.resizableDrag(handle, 0, 80);
equal( target.width(), 70, "compare minWidth");
equal( target.height(), 70, "compare minHeight");
});
@@ -52,11 +52,11 @@ test("aspectRatio: 'preserve' (s)", function() {
var handle = '.ui-resizable-s', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
- drag(handle, 0, 80);
+ TestHelpers.resizableDrag(handle, 0, 80);
equal( target.width(), 130, "compare maxWidth");
equal( target.height(), 130, "compare maxHeight");
- drag(handle, 0, -80);
+ TestHelpers.resizableDrag(handle, 0, -80);
equal( target.width(), 70, "compare minWidth");
equal( target.height(), 70, "compare minHeight");
});
@@ -66,11 +66,11 @@ test("aspectRatio: 'preserve' (se)", function() {
var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
- drag(handle, 80, 80);
+ TestHelpers.resizableDrag(handle, 80, 80);
equal( target.width(), 130, "compare maxWidth");
equal( target.height(), 130, "compare maxHeight");
- drag(handle, -80, -80);
+ TestHelpers.resizableDrag(handle, -80, -80);
equal( target.width(), 70, "compare minWidth");
equal( target.height(), 70, "compare minHeight");
});
@@ -80,11 +80,11 @@ test("aspectRatio: 'preserve' (sw)", function() {
var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
- drag(handle, -80, 80);
+ TestHelpers.resizableDrag(handle, -80, 80);
equal( target.width(), 130, "compare maxWidth");
equal( target.height(), 130, "compare maxHeight");
- drag(handle, 80, -80);
+ TestHelpers.resizableDrag(handle, 80, -80);
equal( target.width(), 70, "compare minWidth");
equal( target.height(), 70, "compare minHeight");
});
@@ -94,11 +94,11 @@ test("aspectRatio: 'preserve' (ne)", function() {
var handle = '.ui-resizable-ne', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
- drag(handle, 80, -80);
+ TestHelpers.resizableDrag(handle, 80, -80);
equal( target.width(), 130, "compare maxWidth");
equal( target.height(), 130, "compare maxHeight");
- drag(handle, -80, 80);
+ TestHelpers.resizableDrag(handle, -80, 80);
equal( target.width(), 70, "compare minWidth");
equal( target.height(), 70, "compare minHeight");
});
@@ -108,11 +108,11 @@ test("grid", function() {
var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all', grid: [0, 20] });
- drag(handle, 3, 9);
+ TestHelpers.resizableDrag(handle, 3, 9);
equal( target.width(), 103, "compare width");
equal( target.height(), 100, "compare height");
- drag(handle, 15, 11);
+ TestHelpers.resizableDrag(handle, 15, 11);
equal( target.width(), 118, "compare width");
equal( target.height(), 120, "compare height");
});
@@ -122,11 +122,11 @@ test("grid (wrapped)", function() {
var handle = '.ui-resizable-se', target = $('#resizable2').resizable({ handles: 'all', grid: [0, 20] });
- drag(handle, 3, 9);
+ TestHelpers.resizableDrag(handle, 3, 9);
equal( target.width(), 103, "compare width");
equal( target.height(), 100, "compare height");
- drag(handle, 15, 11);
+ TestHelpers.resizableDrag(handle, 15, 11);
equal( target.width(), 118, "compare width");
equal( target.height(), 120, "compare height");
});
@@ -136,11 +136,11 @@ test("ui-resizable-se { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1
var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });
- drag(handle, -50, -50);
+ TestHelpers.resizableDrag(handle, -50, -50);
equal( target.width(), 60, "compare minWidth" );
equal( target.height(), 60, "compare minHeight" );
- drag(handle, 70, 70);
+ TestHelpers.resizableDrag(handle, 70, 70);
equal( target.width(), 100, "compare maxWidth" );
equal( target.height(), 100, "compare maxHeight" );
});
@@ -150,11 +150,11 @@ test("ui-resizable-sw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1
var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });
- drag(handle, 50, -50);
+ TestHelpers.resizableDrag(handle, 50, -50);
equal( target.width(), 60, "compare minWidth" );
equal( target.height(), 60, "compare minHeight" );
- drag(handle, -70, 70);
+ TestHelpers.resizableDrag(handle, -70, 70);
equal( target.width(), 100, "compare maxWidth" );
equal( target.height(), 100, "compare maxHeight" );
});
@@ -164,11 +164,11 @@ test("ui-resizable-ne { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1
var handle = '.ui-resizable-ne', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });
- drag(handle, -50, 50);
+ TestHelpers.resizableDrag(handle, -50, 50);
equal( target.width(), 60, "compare minWidth" );
equal( target.height(), 60, "compare minHeight" );
- drag(handle, 70, -70);
+ TestHelpers.resizableDrag(handle, 70, -70);
equal( target.width(), 100, "compare maxWidth" );
equal( target.height(), 100, "compare maxHeight" );
});
@@ -178,11 +178,11 @@ test("ui-resizable-nw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1
var handle = '.ui-resizable-nw', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });
- drag(handle, 70, 70);
+ TestHelpers.resizableDrag(handle, 70, 70);
equal( target.width(), 60, "compare minWidth" );
equal( target.height(), 60, "compare minHeight" );
- drag(handle, -70, -70);
+ TestHelpers.resizableDrag(handle, -70, -70);
equal( target.width(), 100, "compare maxWidth" );
equal( target.height(), 100, "compare maxHeight" );
});