Tooltip: Convert tests to new infrastructure

Ref #10119
Ref gh-1528
This commit is contained in:
Scott González 2015-04-06 20:28:55 -04:00
parent 7d4811206f
commit a2da340e0d
9 changed files with 48 additions and 69 deletions

View File

@ -4,34 +4,8 @@
<meta charset="utf-8">
<title>jQuery UI Tooltip 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", "tooltip" ],
js: [
"ui/core.js",
"ui/widget.js",
"ui/position.js",
"ui/tooltip.js"
]
});
</script>
<script src="tooltip_common.js"></script>
<script src="tooltip_core.js"></script>
<script src="tooltip_events.js"></script>
<script src="tooltip_methods.js"></script>
<script src="tooltip_options.js"></script>
<script src="../swarminject.js"></script>
<script src="../../lib/css.js" data-modules="core tooltip"></script>
<script src="../../lib/bootstrap.js" data-widget="tooltip" data-no-back-compat="true"></script>
</head>
<body>

View File

@ -1,4 +1,9 @@
TestHelpers.commonWidgetTests( "tooltip", {
define( [
"lib/common",
"ui/tooltip"
], function( common ) {
common.testWidget( "tooltip", {
defaults: {
classes: {
"ui-tooltip": "ui-corner-all ui-widget-shadow"
@ -21,3 +26,5 @@ TestHelpers.commonWidgetTests( "tooltip", {
open: null
}
});
} );

View File

@ -1,4 +1,9 @@
TestHelpers.commonWidgetTests( "tooltip", {
define( [
"lib/common",
"ui/tooltip"
], function( common ) {
common.testWidget( "tooltip", {
defaults: {
classes: {
"ui-tooltip": "ui-corner-all ui-widget-shadow"
@ -22,3 +27,5 @@ TestHelpers.commonWidgetTests( "tooltip", {
open: null
}
});
} );

View File

@ -1,4 +1,7 @@
(function( $ ) {
define( [
"jquery",
"ui/tooltip"
], function( $ ) {
module( "tooltip: core" );
@ -218,4 +221,4 @@ asyncTest( "multiple active delegated tooltips", function() {
step1();
});
}( jQuery ) );
} );

View File

@ -4,32 +4,8 @@
<meta charset="utf-8">
<title>jQuery UI Tooltip 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", "tooltip" ],
js: [
"ui/core.js",
"ui/widget.js",
"ui/position.js",
"ui/tooltip.js"
]
});
</script>
<script src="tooltip_common_deprecated.js"></script>
<script src="tooltip_core.js"></script>
<script src="tooltip_events.js"></script>
<script src="tooltip_methods.js"></script>
<script src="tooltip_options.js"></script>
<script src="tooltip_deprecated.js"></script>
<script src="../swarminject.js"></script>
<script src="../../lib/css.js" data-modules="core tooltip"></script>
<script src="../../lib/bootstrap.js" data-widget="tooltip" data-deprecated="true"></script>
</head>
<body>

View File

@ -1,4 +1,7 @@
(function( $ ) {
define( [
"jquery",
"ui/tooltip"
], function( $ ) {
module( "tooltip: (deprecated) options" );
@ -10,4 +13,4 @@ test( "tooltipClass", function( assert ) {
assert.hasClasses( $( "#" + element.data( "ui-tooltip-id" ) ), "custom" );
});
}( jQuery ) );
} );

View File

@ -1,4 +1,7 @@
(function( $ ) {
define( [
"jquery",
"ui/tooltip"
], function( $ ) {
module( "tooltip: events" );
@ -54,4 +57,4 @@ test( "focus events", function() {
element.trigger( "focusout" );
});
}( jQuery ) );
} );

View File

@ -1,17 +1,20 @@
(function( $ ) {
define( [
"jquery",
"ui/tooltip"
], function( $ ) {
module( "tooltip: methods" );
test( "destroy", function() {
test( "destroy", function( assert ) {
expect( 3 );
var element = $( "#tooltipped1" );
domEqual( "#tooltipped1", function() {
assert.domEqual( "#tooltipped1", function() {
element.tooltip().tooltip( "destroy" );
});
// make sure that open tooltips are removed on destroy
domEqual( "#tooltipped1", function() {
assert.domEqual( "#tooltipped1", function() {
element
.tooltip()
.tooltip( "open", $.Event( "mouseover", { target: element[0] }) )
@ -133,4 +136,4 @@ test( "preserve changes to title attributes on close and destroy", function() {
} );
});
}( jQuery ) );
} );

View File

@ -1,4 +1,7 @@
(function( $ ) {
define( [
"jquery",
"ui/tooltip"
], function( $ ) {
module( "tooltip: options" );
@ -209,4 +212,4 @@ test( "track and programmatic focus", function() {
equal( "inputtitle", $( ".ui-tooltip" ).text() );
});
}( jQuery ) );
} );