Skip to content
Permalink
Browse files

Dialog: Convert tests to new infrastructure

Ref #10119
Ref gh-1528
  • Loading branch information...
scottgonzalez committed Apr 7, 2015
1 parent 0714f55 commit 7d4811206f8b64e9bd8eea168a77edf23629659b
@@ -4,42 +4,8 @@
<meta charset="utf-8">
<title>jQuery UI Dialog Test Suite</title>

<script src="../../jquery.js"></script>
<script>
$.uiBackCompat = false;
</script>
<link rel="stylesheet" href="../../../external/qunit/qunit.css">
<script src="../../../external/qunit/qunit.js"></script>
<script src="../../../external/jquery-simulate/jquery.simulate.js"></script>
<script src="../testsuite.js"></script>
<script src="../../../external/qunit-assert-classes/qunit-assert-classes.js"></script>
<script>
TestHelpers.loadResources({
css: [ "core", "dialog" ],
js: [
"ui/core.js",
"ui/widget.js",
"ui/position.js",
"ui/mouse.js",
"ui/draggable.js",
"ui/resizable.js",
"ui/button.js",
"ui/effect.js",
"ui/effect-blind.js",
"ui/effect-explode.js",
"ui/dialog.js"
]
});
</script>

<script src="dialog_common.js"></script>
<script src="dialog_core.js"></script>
<script src="dialog_events.js"></script>
<script src="dialog_methods.js"></script>
<script src="dialog_options.js"></script>
<script src="dialog_test_helpers.js"></script>

<script src="../swarminject.js"></script>
<script src="../../lib/css.js" data-modules="core button dialog"></script>
<script src="../../lib/bootstrap.js" data-widget="dialog" data-no-back-compat="true"></script>
</head>
<body>

@@ -1,4 +1,9 @@
TestHelpers.commonWidgetTests( "dialog", {
define( [
"lib/common",
"ui/dialog"
], function( common ) {

common.testWidget( "dialog", {
defaults: {
appendTo: "body",
autoOpen: true,
@@ -44,3 +49,5 @@ TestHelpers.commonWidgetTests( "dialog", {
resizeStop: null
}
});

} );
@@ -1,4 +1,9 @@
TestHelpers.commonWidgetTests( "dialog", {
define( [
"lib/common",
"ui/dialog"
], function( common ) {

common.testWidget( "dialog", {
defaults: {
appendTo: "body",
autoOpen: true,
@@ -45,3 +50,5 @@ TestHelpers.commonWidgetTests( "dialog", {
resizeStop: null
}
});

} );
@@ -1,8 +1,7 @@
/*
* dialog_core.js
*/

(function($) {
define( [
"jquery",
"ui/dialog"
], function( $ ) {

// TODO add teardown callback to remove dialogs
module("dialog: core");
@@ -306,4 +305,4 @@ asyncTest( "interaction between overlay and other dialogs", function() {
});
});

})(jQuery);
} );
@@ -4,41 +4,8 @@
<meta charset="utf-8">
<title>jQuery UI Dialog Test Suite</title>

<script src="../../jquery.js"></script>
<link rel="stylesheet" href="../../../external/qunit/qunit.css">
<script src="../../../external/qunit/qunit.js"></script>
<script src="../../../external/jquery-simulate/jquery.simulate.js"></script>
<script src="../testsuite.js"></script>
<script src="../../../external/qunit-assert-classes/qunit-assert-classes.js"></script>
<script>
TestHelpers.loadResources({
css: [ "core", "dialog" ],
js: [
"ui/core.js",
"ui/widget.js",
"ui/position.js",
"ui/mouse.js",
"ui/draggable.js",
"ui/resizable.js",
"ui/button.js",
"ui/effect.js",
"ui/effect-blind.js",
"ui/effect-clip.js",
"ui/effect-explode.js",
"ui/dialog.js"
]
});
</script>

<script src="dialog_common_deprecated.js"></script>
<script src="dialog_core.js"></script>
<script src="dialog_events.js"></script>
<script src="dialog_methods.js"></script>
<script src="dialog_options.js"></script>
<script src="dialog_deprecated.js"></script>
<script src="dialog_test_helpers.js"></script>

<script src="../swarminject.js"></script>
<script src="../../lib/css.js" data-modules="core button dialog"></script>
<script src="../../lib/bootstrap.js" data-widget="dialog" data-deprecated="true"></script>
</head>
<body>

@@ -1,4 +1,7 @@
(function( $ ) {
define( [
"jquery",
"ui/dialog"
], function( $ ) {

module( "dialog (deprecated): options" );

@@ -24,4 +27,4 @@ test( "dialogClass", function( assert ) {
element.remove();
});

})( jQuery );
} );
@@ -1,7 +1,8 @@
/*
* dialog_events.js
*/
(function($) {
define( [
"jquery",
"./dialog_test_helpers",
"ui/dialog"
], function( $, dialogTestHelpers ) {

module("dialog: events");

@@ -103,7 +104,7 @@ test("dragStart", function() {
});

handle = $(".ui-dialog-titlebar", element.dialog("widget"));
TestHelpers.dialog.drag(element, handle, 50, 50);
dialogTestHelpers.drag(element, handle, 50, 50);
element.remove();
});

@@ -131,7 +132,7 @@ test("drag", function() {
});

handle = $(".ui-dialog-titlebar", element.dialog("widget"));
TestHelpers.dialog.drag(element, handle, 50, 50);
dialogTestHelpers.drag(element, handle, 50, 50);
element.remove();
});

@@ -155,7 +156,7 @@ test("dragStop", function() {
});

handle = $(".ui-dialog-titlebar", element.dialog("widget"));
TestHelpers.dialog.drag(element, handle, 50, 50);
dialogTestHelpers.drag(element, handle, 50, 50);
element.remove();
});

@@ -183,7 +184,7 @@ test("resizeStart", function() {
});

handle = $(".ui-resizable-se", element.dialog("widget"));
TestHelpers.dialog.drag(element, handle, 50, 50);
dialogTestHelpers.drag(element, handle, 50, 50);
element.remove();
});

@@ -215,7 +216,7 @@ test("resize", function() {
});

handle = $(".ui-resizable-se", element.dialog("widget"));
TestHelpers.dialog.drag(element, handle, 50, 50);
dialogTestHelpers.drag(element, handle, 50, 50);
element.remove();
});

@@ -243,7 +244,7 @@ test("resizeStop", function() {
});

handle = $(".ui-resizable-se", element.dialog("widget"));
TestHelpers.dialog.drag(element, handle, 50, 50);
dialogTestHelpers.drag(element, handle, 50, 50);
element.remove();
});

@@ -366,4 +367,4 @@ test("ensure dialog keeps focus when clicking modal overlay", function() {
element.remove();
});

})(jQuery);
} );
@@ -1,7 +1,7 @@
/*
* dialog_methods.js
*/
(function($) {
define( [
"jquery",
"ui/dialog"
], function( $ ) {

module("dialog: methods", {
teardown: function() {
@@ -33,18 +33,18 @@ test("init", function() {
ok(true, "arbitrary option setter after init");
});

test("destroy", function() {
test("destroy", function( assert ) {
expect( 17 );

var element, element2;

$( "#dialog1, #form-dialog" ).hide();
domEqual( "#dialog1", function() {
assert.domEqual( "#dialog1", function() {
var dialog = $( "#dialog1" ).dialog().dialog( "destroy" );
equal( dialog.parent()[ 0 ], $( "#qunit-fixture" )[ 0 ] );
equal( dialog.index(), 0 );
});
domEqual( "#form-dialog", function() {
assert.domEqual( "#form-dialog", function() {
var dialog = $( "#form-dialog" ).dialog().dialog( "destroy" );
equal( dialog.parent()[ 0 ], $( "#qunit-fixture" )[ 0 ] );
equal( dialog.index(), 2 );
@@ -56,7 +56,7 @@ test("destroy", function() {
minHeight: "100px",
height: "200px"
});
domEqual( "#dialog1", function() {
assert.domEqual( "#dialog1", function() {
$( "#dialog1" ).dialog().dialog( "destroy" );
});

@@ -264,4 +264,4 @@ test("#5531: dialog width should be at least minWidth on creation", function ()

});

})(jQuery);
} );
Oops, something went wrong.

0 comments on commit 7d48112

Please sign in to comment.
You can’t perform that action at this time.