aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/dialog/dialog_options.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2015-04-06 20:23:50 -0400
committerScott González <scott.gonzalez@gmail.com>2015-04-09 09:26:27 -0400
commit7d4811206f8b64e9bd8eea168a77edf23629659b (patch)
treeb22edbe4117b692ced3f803fd5192c046229e56e /tests/unit/dialog/dialog_options.js
parent0714f55ad48c9d3dace29003677353f5e152a13a (diff)
downloadjquery-ui-7d4811206f8b64e9bd8eea168a77edf23629659b.tar.gz
jquery-ui-7d4811206f8b64e9bd8eea168a77edf23629659b.zip
Dialog: Convert tests to new infrastructure
Ref #10119 Ref gh-1528
Diffstat (limited to 'tests/unit/dialog/dialog_options.js')
-rw-r--r--tests/unit/dialog/dialog_options.js61
1 files changed, 32 insertions, 29 deletions
diff --git a/tests/unit/dialog/dialog_options.js b/tests/unit/dialog/dialog_options.js
index 1c3648f11..e4ff6ac72 100644
--- a/tests/unit/dialog/dialog_options.js
+++ b/tests/unit/dialog/dialog_options.js
@@ -1,7 +1,10 @@
-/*
- * dialog_options.js
- */
-(function($) {
+define( [
+ "jquery",
+ "./dialog_test_helpers",
+ "ui/dialog",
+ "ui/effect-blind",
+ "ui/effect-explode"
+], function( $, dialogTestHelpers ) {
module("dialog: options");
@@ -228,15 +231,15 @@ test("draggable", function() {
var element = $("<div></div>").dialog({ draggable: false });
- TestHelpers.dialog.testDrag(element, 50, -50, 0, 0);
+ dialogTestHelpers.testDrag(element, 50, -50, 0, 0);
element.dialog("option", "draggable", true);
- TestHelpers.dialog.testDrag(element, 50, -50, 50, -50);
+ dialogTestHelpers.testDrag(element, 50, -50, 50, -50);
element.remove();
element = $("<div></div>").dialog({ draggable: true });
- TestHelpers.dialog.testDrag(element, 50, -50, 50, -50);
+ dialogTestHelpers.testDrag(element, 50, -50, 50, -50);
element.dialog("option", "draggable", false);
- TestHelpers.dialog.testDrag(element, 50, -50, 0, 0);
+ dialogTestHelpers.testDrag(element, 50, -50, 0, 0);
element.remove();
});
@@ -266,17 +269,17 @@ test("maxHeight", function( assert ) {
expect(3);
var element = $("<div></div>").dialog({ maxHeight: 200 });
- TestHelpers.dialog.drag(element, ".ui-resizable-s", 1000, 1000);
+ dialogTestHelpers.drag(element, ".ui-resizable-s", 1000, 1000);
assert.close(element.dialog("widget").height(), 200, 1, "maxHeight");
element.remove();
element = $("<div></div>").dialog({ maxHeight: 200 });
- TestHelpers.dialog.drag(element, ".ui-resizable-n", -1000, -1000);
+ dialogTestHelpers.drag(element, ".ui-resizable-n", -1000, -1000);
assert.close(element.dialog("widget").height(), 200, 1, "maxHeight");
element.remove();
element = $("<div></div>").dialog({ maxHeight: 200 }).dialog("option", "maxHeight", 300);
- TestHelpers.dialog.drag(element, ".ui-resizable-s", 1000, 1000);
+ dialogTestHelpers.drag(element, ".ui-resizable-s", 1000, 1000);
assert.close(element.dialog("widget").height(), 300, 1, "maxHeight");
element.remove();
});
@@ -285,17 +288,17 @@ test("maxWidth", function( assert ) {
expect(3);
var element = $("<div></div>").dialog({ maxWidth: 200 });
- TestHelpers.dialog.drag(element, ".ui-resizable-e", 1000, 1000);
+ dialogTestHelpers.drag(element, ".ui-resizable-e", 1000, 1000);
assert.close(element.dialog("widget").width(), 200, 1, "maxWidth");
element.remove();
element = $("<div></div>").dialog({ maxWidth: 200 });
- TestHelpers.dialog.drag(element, ".ui-resizable-w", -1000, -1000);
+ dialogTestHelpers.drag(element, ".ui-resizable-w", -1000, -1000);
assert.close(element.dialog("widget").width(), 200, 1, "maxWidth");
element.remove();
element = $("<div></div>").dialog({ maxWidth: 200 }).dialog("option", "maxWidth", 300);
- TestHelpers.dialog.drag(element, ".ui-resizable-w", -1000, -1000);
+ dialogTestHelpers.drag(element, ".ui-resizable-w", -1000, -1000);
assert.close(element.dialog("widget").width(), 300, 1, "maxWidth");
element.remove();
});
@@ -304,17 +307,17 @@ test("minHeight", function( assert ) {
expect(3);
var element = $("<div></div>").dialog({ minHeight: 10 });
- TestHelpers.dialog.drag(element, ".ui-resizable-s", -1000, -1000);
+ dialogTestHelpers.drag(element, ".ui-resizable-s", -1000, -1000);
assert.close(element.dialog("widget").height(), 10, 1, "minHeight");
element.remove();
element = $("<div></div>").dialog({ minHeight: 10 });
- TestHelpers.dialog.drag(element, ".ui-resizable-n", 1000, 1000);
+ dialogTestHelpers.drag(element, ".ui-resizable-n", 1000, 1000);
assert.close(element.dialog("widget").height(), 10, 1, "minHeight");
element.remove();
element = $("<div></div>").dialog({ minHeight: 10 }).dialog("option", "minHeight", 30);
- TestHelpers.dialog.drag(element, ".ui-resizable-n", 1000, 1000);
+ dialogTestHelpers.drag(element, ".ui-resizable-n", 1000, 1000);
assert.close(element.dialog("widget").height(), 30, 1, "minHeight");
element.remove();
});
@@ -323,17 +326,17 @@ test("minWidth", function( assert ) {
expect(3);
var element = $("<div></div>").dialog({ minWidth: 10 });
- TestHelpers.dialog.drag(element, ".ui-resizable-e", -1000, -1000);
+ dialogTestHelpers.drag(element, ".ui-resizable-e", -1000, -1000);
assert.close(element.dialog("widget").width(), 10, 1, "minWidth");
element.remove();
element = $("<div></div>").dialog({ minWidth: 10 });
- TestHelpers.dialog.drag(element, ".ui-resizable-w", 1000, 1000);
+ dialogTestHelpers.drag(element, ".ui-resizable-w", 1000, 1000);
assert.close(element.dialog("widget").width(), 10, 1, "minWidth");
element.remove();
element = $("<div></div>").dialog({ minWidth: 30 }).dialog("option", "minWidth", 30);
- TestHelpers.dialog.drag(element, ".ui-resizable-w", 1000, 1000);
+ dialogTestHelpers.drag(element, ".ui-resizable-w", 1000, 1000);
assert.close(element.dialog("widget").width(), 30, 1, "minWidth");
element.remove();
});
@@ -421,15 +424,15 @@ test("resizable", function() {
expect(4);
var element = $("<div></div>").dialog();
- TestHelpers.dialog.shouldResize(element, 50, 50, "[default]");
+ dialogTestHelpers.shouldResize(element, 50, 50, "[default]");
element.dialog("option", "resizable", false);
- TestHelpers.dialog.shouldResize(element, 0, 0, "disabled after init");
+ dialogTestHelpers.shouldResize(element, 0, 0, "disabled after init");
element.remove();
element = $("<div></div>").dialog({ resizable: false });
- TestHelpers.dialog.shouldResize(element, 0, 0, "disabled in init options");
+ dialogTestHelpers.shouldResize(element, 0, 0, "disabled in init options");
element.dialog("option", "resizable", true);
- TestHelpers.dialog.shouldResize(element, 50, 50, "enabled after init");
+ dialogTestHelpers.shouldResize(element, 50, 50, "enabled after init");
element.remove();
});
@@ -494,18 +497,18 @@ test("#4826: setting resizable false toggles resizable on dialog", function() {
var i,
element = $("<div></div>").dialog({ resizable: false });
- TestHelpers.dialog.shouldResize(element, 0, 0, "[default]");
+ dialogTestHelpers.shouldResize(element, 0, 0, "[default]");
for (i=0; i<2; i++) {
element.dialog("close").dialog("open");
- TestHelpers.dialog.shouldResize(element, 0, 0, "initialized with resizable false toggle ("+ (i+1) +")");
+ dialogTestHelpers.shouldResize(element, 0, 0, "initialized with resizable false toggle ("+ (i+1) +")");
}
element.remove();
element = $("<div></div>").dialog({ resizable: true });
- TestHelpers.dialog.shouldResize(element, 50, 50, "[default]");
+ dialogTestHelpers.shouldResize(element, 50, 50, "[default]");
for (i=0; i<2; i++) {
element.dialog("close").dialog("option", "resizable", false).dialog("open");
- TestHelpers.dialog.shouldResize(element, 0, 0, "set option resizable false toggle ("+ (i+1) +")");
+ dialogTestHelpers.shouldResize(element, 0, 0, "set option resizable false toggle ("+ (i+1) +")");
}
element.remove();
@@ -551,4 +554,4 @@ asyncTest( "Open followed by close during show effect", function() {
}, 100 );
});
-})(jQuery);
+} );