aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/resizable
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2012-02-28 15:56:32 +0100
committerJörn Zaefferer <joern.zaefferer@gmail.com>2012-02-29 18:36:40 +0100
commit72023dd045a7fead5a3136ec2400ad4743a190d2 (patch)
tree4999a287a815e6a4200498a2a0241abc349fe599 /tests/unit/resizable
parente6b7486abf2e0f98837e76027084fad6fe908cff (diff)
downloadjquery-ui-72023dd045a7fead5a3136ec2400ad4743a190d2.tar.gz
jquery-ui-72023dd045a7fead5a3136ec2400ad4743a190d2.zip
Update to QUnit 1.3. Replace usage of same with deepEqual and equals with equal.
Diffstat (limited to 'tests/unit/resizable')
-rw-r--r--tests/unit/resizable/resizable_core.js50
-rw-r--r--tests/unit/resizable/resizable_methods.js6
-rw-r--r--tests/unit/resizable/resizable_options.js104
3 files changed, 80 insertions, 80 deletions
diff --git a/tests/unit/resizable/resizable_core.js b/tests/unit/resizable/resizable_core.js
index 33a3f723b..aef2ae15c 100644
--- a/tests/unit/resizable/resizable_core.js
+++ b/tests/unit/resizable/resizable_core.js
@@ -14,7 +14,7 @@ var drag = function(el, dx, dy, complete) {
$(el).simulate("mouseover");
return $(el).simulate("drag", {
- dx: dx||0, dy: dy||0, speed: 'sync', complete: complete
+ dx: dx||0, dy: dy||0, speed: 'sync', complete: complete
});
};
@@ -47,10 +47,10 @@ test("n", function() {
var handle = '.ui-resizable-n', target = $('#resizable1').resizable({ handles: 'all' });
drag(handle, 0, -50);
- equals( target.height(), 150, "compare height" );
+ equal( target.height(), 150, "compare height" );
drag(handle, 0, 50);
- equals( target.height(), 100, "compare height" );
+ equal( target.height(), 100, "compare height" );
});
test("s", function() {
@@ -59,10 +59,10 @@ test("s", function() {
var handle = '.ui-resizable-s', target = $('#resizable1').resizable({ handles: 'all' });
drag(handle, 0, 50);
- equals( target.height(), 150, "compare height" );
+ equal( target.height(), 150, "compare height" );
drag(handle, 0, -50);
- equals( target.height(), 100, "compare height" );
+ equal( target.height(), 100, "compare height" );
});
test("e", function() {
@@ -71,10 +71,10 @@ test("e", function() {
var handle = '.ui-resizable-e', target = $('#resizable1').resizable({ handles: 'all' });
drag(handle, 50);
- equals( target.width(), 150, "compare width");
+ equal( target.width(), 150, "compare width");
drag(handle, -50);
- equals( target.width(), 100, "compare width" );
+ equal( target.width(), 100, "compare width" );
});
test("w", function() {
@@ -83,10 +83,10 @@ test("w", function() {
var handle = '.ui-resizable-w', target = $('#resizable1').resizable({ handles: 'all' });
drag(handle, -50);
- equals( target.width(), 150, "compare width" );
+ equal( target.width(), 150, "compare width" );
drag(handle, 50);
- equals( target.width(), 100, "compare width" );
+ equal( target.width(), 100, "compare width" );
});
test("ne", function() {
@@ -95,12 +95,12 @@ test("ne", function() {
var handle = '.ui-resizable-ne', target = $('#resizable1').css({ overflow: 'hidden' }).resizable({ handles: 'all' });
drag(handle, -50, -50);
- equals( target.width(), 50, "compare width" );
- equals( target.height(), 150, "compare height" );
+ equal( target.width(), 50, "compare width" );
+ equal( target.height(), 150, "compare height" );
drag(handle, 50, 50);
- equals( target.width(), 100, "compare width" );
- equals( target.height(), 100, "compare height" );
+ equal( target.width(), 100, "compare width" );
+ equal( target.height(), 100, "compare height" );
});
test("se", function() {
@@ -109,12 +109,12 @@ test("se", function() {
var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all' });
drag(handle, 50, 50);
- equals( target.width(), 150, "compare width" );
- equals( target.height(), 150, "compare height" );
+ equal( target.width(), 150, "compare width" );
+ equal( target.height(), 150, "compare height" );
drag(handle, -50, -50);
- equals( target.width(), 100, "compare width" );
- equals( target.height(), 100, "compare height" );
+ equal( target.width(), 100, "compare width" );
+ equal( target.height(), 100, "compare height" );
});
test("sw", function() {
@@ -123,12 +123,12 @@ test("sw", function() {
var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ handles: 'all' });
drag(handle, -50, -50);
- equals( target.width(), 150, "compare width" );
- equals( target.height(), 50, "compare height" );
+ equal( target.width(), 150, "compare width" );
+ equal( target.height(), 50, "compare height" );
drag(handle, 50, 50);
- equals( target.width(), 100, "compare width" );
- equals( target.height(), 100, "compare height" );
+ equal( target.width(), 100, "compare width" );
+ equal( target.height(), 100, "compare height" );
});
test("nw", function() {
@@ -137,12 +137,12 @@ test("nw", function() {
var handle = '.ui-resizable-nw', target = $('#resizable1').resizable({ handles: 'all' });
drag(handle, -50, -50);
- equals( target.width(), 150, "compare width" );
- equals( target.height(), 150, "compare height" );
+ equal( target.width(), 150, "compare width" );
+ equal( target.height(), 150, "compare height" );
drag(handle, 50, 50);
- equals( target.width(), 100, "compare width" );
- equals( target.height(), 100, "compare height" );
+ equal( target.width(), 100, "compare width" );
+ equal( target.height(), 100, "compare height" );
});
})(jQuery);
diff --git a/tests/unit/resizable/resizable_methods.js b/tests/unit/resizable/resizable_methods.js
index 6ac287fe2..03e91d440 100644
--- a/tests/unit/resizable/resizable_methods.js
+++ b/tests/unit/resizable/resizable_methods.js
@@ -44,20 +44,20 @@ test("destroy", function() {
var expected = $('<div></div>').resizable(),
actual = expected.resizable('destroy');
- equals(actual, expected, 'destroy is chainable');
+ equal(actual, expected, 'destroy is chainable');
});
test("enable", function() {
var expected = $('<div></div>').resizable(),
actual = expected.resizable('enable');
- equals(actual, expected, 'enable is chainable');
+ equal(actual, expected, 'enable is chainable');
ok(false, "missing test - untested code is broken code.");
});
test("disable", function() {
var expected = $('<div></div>').resizable(),
actual = expected.resizable('disable');
- equals(actual, expected, 'disable is chainable');
+ equal(actual, expected, 'disable is chainable');
ok(false, "missing test - untested code is broken code.");
});
diff --git a/tests/unit/resizable/resizable_options.js b/tests/unit/resizable/resizable_options.js
index 389931f92..76cca560a 100644
--- a/tests/unit/resizable/resizable_options.js
+++ b/tests/unit/resizable/resizable_options.js
@@ -11,12 +11,12 @@ 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);
- equals( target.width(), 130, "compare maxWidth");
- equals( target.height(), 130, "compare maxHeight");
+ equal( target.width(), 130, "compare maxWidth");
+ equal( target.height(), 130, "compare maxHeight");
drag(handle, -130);
- equals( target.width(), 70, "compare minWidth");
- equals( target.height(), 70, "compare minHeight");
+ equal( target.width(), 70, "compare minWidth");
+ equal( target.height(), 70, "compare minHeight");
});
test("aspectRatio: 'preserve' (w)", function() {
@@ -25,12 +25,12 @@ 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);
- equals( target.width(), 130, "compare maxWidth");
- equals( target.height(), 130, "compare maxHeight");
+ equal( target.width(), 130, "compare maxWidth");
+ equal( target.height(), 130, "compare maxHeight");
drag(handle, 130);
- equals( target.width(), 70, "compare minWidth");
- equals( target.height(), 70, "compare minHeight");
+ equal( target.width(), 70, "compare minWidth");
+ equal( target.height(), 70, "compare minHeight");
});
test("aspectRatio: 'preserve' (n)", function() {
@@ -39,12 +39,12 @@ 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);
- equals( target.width(), 130, "compare maxWidth");
- equals( target.height(), 130, "compare maxHeight");
+ equal( target.width(), 130, "compare maxWidth");
+ equal( target.height(), 130, "compare maxHeight");
drag(handle, 0, 80);
- equals( target.width(), 70, "compare minWidth");
- equals( target.height(), 70, "compare minHeight");
+ equal( target.width(), 70, "compare minWidth");
+ equal( target.height(), 70, "compare minHeight");
});
test("aspectRatio: 'preserve' (s)", function() {
@@ -53,12 +53,12 @@ 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);
- equals( target.width(), 130, "compare maxWidth");
- equals( target.height(), 130, "compare maxHeight");
+ equal( target.width(), 130, "compare maxWidth");
+ equal( target.height(), 130, "compare maxHeight");
drag(handle, 0, -80);
- equals( target.width(), 70, "compare minWidth");
- equals( target.height(), 70, "compare minHeight");
+ equal( target.width(), 70, "compare minWidth");
+ equal( target.height(), 70, "compare minHeight");
});
test("aspectRatio: 'preserve' (se)", function() {
@@ -67,12 +67,12 @@ 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);
- equals( target.width(), 130, "compare maxWidth");
- equals( target.height(), 130, "compare maxHeight");
+ equal( target.width(), 130, "compare maxWidth");
+ equal( target.height(), 130, "compare maxHeight");
drag(handle, -80, -80);
- equals( target.width(), 70, "compare minWidth");
- equals( target.height(), 70, "compare minHeight");
+ equal( target.width(), 70, "compare minWidth");
+ equal( target.height(), 70, "compare minHeight");
});
test("aspectRatio: 'preserve' (sw)", function() {
@@ -81,12 +81,12 @@ 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);
- equals( target.width(), 130, "compare maxWidth");
- equals( target.height(), 130, "compare maxHeight");
+ equal( target.width(), 130, "compare maxWidth");
+ equal( target.height(), 130, "compare maxHeight");
drag(handle, 80, -80);
- equals( target.width(), 70, "compare minWidth");
- equals( target.height(), 70, "compare minHeight");
+ equal( target.width(), 70, "compare minWidth");
+ equal( target.height(), 70, "compare minHeight");
});
test("aspectRatio: 'preserve' (ne)", function() {
@@ -95,12 +95,12 @@ 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);
- equals( target.width(), 130, "compare maxWidth");
- equals( target.height(), 130, "compare maxHeight");
+ equal( target.width(), 130, "compare maxWidth");
+ equal( target.height(), 130, "compare maxHeight");
drag(handle, -80, 80);
- equals( target.width(), 70, "compare minWidth");
- equals( target.height(), 70, "compare minHeight");
+ equal( target.width(), 70, "compare minWidth");
+ equal( target.height(), 70, "compare minHeight");
});
test("grid", function() {
@@ -109,12 +109,12 @@ test("grid", function() {
var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all', grid: [0, 20] });
drag(handle, 3, 9);
- equals( target.width(), 103, "compare width");
- equals( target.height(), 100, "compare height");
+ equal( target.width(), 103, "compare width");
+ equal( target.height(), 100, "compare height");
drag(handle, 15, 11);
- equals( target.width(), 118, "compare width");
- equals( target.height(), 120, "compare height");
+ equal( target.width(), 118, "compare width");
+ equal( target.height(), 120, "compare height");
});
test("grid (wrapped)", function() {
@@ -123,12 +123,12 @@ test("grid (wrapped)", function() {
var handle = '.ui-resizable-se', target = $('#resizable2').resizable({ handles: 'all', grid: [0, 20] });
drag(handle, 3, 9);
- equals( target.width(), 103, "compare width");
- equals( target.height(), 100, "compare height");
+ equal( target.width(), 103, "compare width");
+ equal( target.height(), 100, "compare height");
drag(handle, 15, 11);
- equals( target.width(), 118, "compare width");
- equals( target.height(), 120, "compare height");
+ equal( target.width(), 118, "compare width");
+ equal( target.height(), 120, "compare height");
});
test("ui-resizable-se { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }", function() {
@@ -137,12 +137,12 @@ 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);
- equals( target.width(), 60, "compare minWidth" );
- equals( target.height(), 60, "compare minHeight" );
+ equal( target.width(), 60, "compare minWidth" );
+ equal( target.height(), 60, "compare minHeight" );
drag(handle, 70, 70);
- equals( target.width(), 100, "compare maxWidth" );
- equals( target.height(), 100, "compare maxHeight" );
+ equal( target.width(), 100, "compare maxWidth" );
+ equal( target.height(), 100, "compare maxHeight" );
});
test("ui-resizable-sw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }", function() {
@@ -151,12 +151,12 @@ 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);
- equals( target.width(), 60, "compare minWidth" );
- equals( target.height(), 60, "compare minHeight" );
+ equal( target.width(), 60, "compare minWidth" );
+ equal( target.height(), 60, "compare minHeight" );
drag(handle, -70, 70);
- equals( target.width(), 100, "compare maxWidth" );
- equals( target.height(), 100, "compare maxHeight" );
+ equal( target.width(), 100, "compare maxWidth" );
+ equal( target.height(), 100, "compare maxHeight" );
});
test("ui-resizable-ne { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }", function() {
@@ -165,12 +165,12 @@ 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);
- equals( target.width(), 60, "compare minWidth" );
- equals( target.height(), 60, "compare minHeight" );
+ equal( target.width(), 60, "compare minWidth" );
+ equal( target.height(), 60, "compare minHeight" );
drag(handle, 70, -70);
- equals( target.width(), 100, "compare maxWidth" );
- equals( target.height(), 100, "compare maxHeight" );
+ equal( target.width(), 100, "compare maxWidth" );
+ equal( target.height(), 100, "compare maxHeight" );
});
test("ui-resizable-nw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }", function() {
@@ -179,12 +179,12 @@ 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);
- equals( target.width(), 60, "compare minWidth" );
- equals( target.height(), 60, "compare minHeight" );
+ equal( target.width(), 60, "compare minWidth" );
+ equal( target.height(), 60, "compare minHeight" );
drag(handle, -70, -70);
- equals( target.width(), 100, "compare maxWidth" );
- equals( target.height(), 100, "compare maxHeight" );
+ equal( target.width(), 100, "compare maxWidth" );
+ equal( target.height(), 100, "compare maxHeight" );
});
})(jQuery);