diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/accordion/accordion_core.js | 2 | ||||
-rw-r--r-- | tests/unit/all.html | 51 | ||||
-rw-r--r-- | tests/unit/menu/menu_events.js | 1 | ||||
-rw-r--r-- | tests/unit/testsuites.js | 76 | ||||
-rw-r--r-- | tests/visual/datepicker/datepicker_ticket_7552.html | 8 | ||||
-rw-r--r-- | tests/visual/effects/effects.scale.html | 2 | ||||
-rw-r--r-- | tests/visual/position/position_within.html | 12 |
7 files changed, 139 insertions, 13 deletions
diff --git a/tests/unit/accordion/accordion_core.js b/tests/unit/accordion/accordion_core.js index ec4ca29d5..18d2d6bfb 100644 --- a/tests/unit/accordion/accordion_core.js +++ b/tests/unit/accordion/accordion_core.js @@ -3,8 +3,8 @@ module( "accordion: core", accordionSetupTeardown() ); $.each( { div: "#list1", ul: "#navigation", dl: "#accordion-dl" }, function( type, selector ) { - expect( 4 ); test( "markup structure: " + type, function() { + expect( 4 ); var element = $( selector ).accordion(); ok( element.hasClass( "ui-accordion" ), "main element is .ui-accordion" ); equal( element.find( ".ui-accordion-header" ).length, 3, diff --git a/tests/unit/all.html b/tests/unit/all.html new file mode 100644 index 000000000..a36c9e004 --- /dev/null +++ b/tests/unit/all.html @@ -0,0 +1,51 @@ +<!doctype html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>jQuery UI Test Suite</title> + + <script src="../../jquery-1.6.2.js"></script> + + <link rel="stylesheet" href="../../external/qunit.css"> + <script src="../../external/qunit.js"></script> + <script src="testsuites.js"></script> + + <script> + QUnit.testSuites([ + "accordion/accordion.html", + "accordion/accordion_deprecated.html", + "autocomplete/autocomplete.html", + "button/button.html", + "core/core.html", + "datepicker/datepicker.html", + "dialog/dialog.html", + //"draggable/draggable.html", + //"droppable/droppable.html", + "effects/effects.html", + "menu/menu.html", + "position/position.html", + "progressbar/progressbar.html", + //"resizable/resizable.html", + //"selectable/selectable.html", + "slider/slider.html", + //"sortable/sortable.html", + "spinner/spinner.html", + "tabs/tabs.html", + "tabs/tabs_deprecated.html", + "tooltip/tooltip.html", + "widget/widget.html" + ]); + </script> +</head> +<body> + +<h1 id="qunit-header">jQuery UI Test Suite</h1> +<h2 id="qunit-banner"></h2> +<div id="qunit-testrunner-toolbar"></div> +<h2 id="qunit-userAgent"></h2> +<ol id="qunit-tests"></ol> +<div id="qunit-fixture"> + +</div> +</body> +</html> diff --git a/tests/unit/menu/menu_events.js b/tests/unit/menu/menu_events.js index b949c827d..19ac11c68 100644 --- a/tests/unit/menu/menu_events.js +++ b/tests/unit/menu/menu_events.js @@ -30,7 +30,6 @@ test( "handle blur: click", function() { }, blur: function( event, ui ) { - console.log( event, ui ); equal( event.originalEvent.type, "click", "blur triggered 'click'" ); equal( event.type, "menublur", "blur event.type is 'menublur'" ); } diff --git a/tests/unit/testsuites.js b/tests/unit/testsuites.js new file mode 100644 index 000000000..ffe2d3cc0 --- /dev/null +++ b/tests/unit/testsuites.js @@ -0,0 +1,76 @@ +(function( $, QUnit ) { + +$.extend( QUnit, { + testSuites: function( suites ) { + $.each( suites, function( i, suite ) { + asyncTest( suite, function() { + runSuite( suite ); + }); + }); + }, + + testStart: function( data ) { + // update the test status to show which test suite is running + $( "#qunit-testresult" ).html( "Running " + data.name + "...<br> " ); + }, + + testDone: function() { + // undo the auto-expansion of failed tests + $( "#qunit-tests > li.fail" ).each(function() { + var test = $( this ); + // avoid collapsing test results that the user manually opened + if ( test.data( "auto-collapsed" ) ) { + return; + } + test.data( "auto-collapsed", true ) + .children( "ol" ).hide(); + }); + } +}); + +// generate an iframe to run the test suite and proxy the iframe's QUnit +// to pass all test info to the main page +function runSuite( suite ) { + var body = $( "body" ), + iframe = $( "<iframe>", { src: suite } ) + .css({ + width: 1000, + height: 1000 + }) + .appendTo( body ) + [0], + iframeWin = iframe.contentWindow; + + $( iframeWin ).bind( "load", function() { + var module, test, + count = 0; + + $.extend( iframeWin.QUnit, { + moduleStart: function( data ) { + // capture module name for messages + module = data.name; + }, + + testStart: function( data ) { + // capture test name for messages + test = data.name; + }, + + log: function( data ) { + // pass all test details through to the main page + var message = module + ": " + test + ": " + data.message; + expect( ++count ); + QUnit.push( data.result, data.actual, data.expected, message ); + }, + + done: function() { + // hide the iframe from the main page once the tests are done + // and start the wrapper test from the main page + $( iframe ).hide(); + start(); + } + }); + }); +} + +}( jQuery, QUnit ) ); diff --git a/tests/visual/datepicker/datepicker_ticket_7552.html b/tests/visual/datepicker/datepicker_ticket_7552.html index a78a84818..5ec093975 100644 --- a/tests/visual/datepicker/datepicker_ticket_7552.html +++ b/tests/visual/datepicker/datepicker_ticket_7552.html @@ -5,10 +5,10 @@ <title>Datepicker Visual Test : Datepicker ticket #7552</title> <link rel="stylesheet" href="../visual.css" type="text/css" /> <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css"> - <script type="text/javascript" src="../../../jquery-1.5.1.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.datepicker.js"></script> + <script src="../../../jquery-1.6.2.js"></script> + <script src="../../../ui/jquery.ui.core.js"></script> + <script src="../../../ui/jquery.ui.widget.js"></script> + <script src="../../../ui/jquery.ui.datepicker.js"></script> <script type="text/javascript"> $(function() { $('<div></div>').datepicker().appendTo("body"); diff --git a/tests/visual/effects/effects.scale.html b/tests/visual/effects/effects.scale.html index 9521a1872..5bcded605 100644 --- a/tests/visual/effects/effects.scale.html +++ b/tests/visual/effects/effects.scale.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Effects Test Suite</title> <link rel="stylesheet" href="effects.all.css" type="text/css"> - <script src="../../../jquery-1.5.1.js"></script> + <script src="../../../jquery-1.6.2.js"></script> <script src="../../../ui/jquery.effects.core.js"></script> <script src="../../../ui/jquery.effects.scale.js"></script> <script src="effects.all.js"></script> diff --git a/tests/visual/position/position_within.html b/tests/visual/position/position_within.html index 4440a0975..df8d637ea 100644 --- a/tests/visual/position/position_within.html +++ b/tests/visual/position/position_within.html @@ -7,12 +7,12 @@ <link rel="stylesheet" href="../visual.css" type="text/css" /> <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" /> - <script type="text/javascript" src="../../../jquery-1.5.1.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.mouse.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.draggable.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script> + <script src="../../../jquery-1.6.2.js"></script> + <script src="../../../ui/jquery.ui.core.js"></script> + <script src="../../../ui/jquery.ui.widget.js"></script> + <script src="../../../ui/jquery.ui.mouse.js"></script> + <script src="../../../ui/jquery.ui.draggable.js"></script> + <script src="../../../ui/jquery.ui.position.js"></script> <style> html, body { |