diff options
author | Scott González <scott.gonzalez@gmail.com> | 2015-04-03 15:57:57 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2015-04-09 09:24:45 -0400 |
commit | aff3c32ee1f0b81ecea613057e95a40d8edc6b03 (patch) | |
tree | dd466998346a8f64153f258b044b5f4348a853c2 | |
parent | e39ee9d6695cebd4ec138b1d5391c67c58d939a9 (diff) | |
download | jquery-ui-aff3c32ee1f0b81ecea613057e95a40d8edc6b03.tar.gz jquery-ui-aff3c32ee1f0b81ecea613057e95a40d8edc6b03.zip |
Autocomplete: Convert tests to new infrastructure
Ref #10119
Ref gh-1528
-rw-r--r-- | tests/unit/autocomplete/autocomplete.html | 28 | ||||
-rw-r--r-- | tests/unit/autocomplete/autocomplete_common.js | 9 | ||||
-rw-r--r-- | tests/unit/autocomplete/autocomplete_core.js | 7 | ||||
-rw-r--r-- | tests/unit/autocomplete/autocomplete_events.js | 7 | ||||
-rw-r--r-- | tests/unit/autocomplete/autocomplete_methods.js | 11 | ||||
-rw-r--r-- | tests/unit/autocomplete/autocomplete_options.js | 7 |
6 files changed, 32 insertions, 37 deletions
diff --git a/tests/unit/autocomplete/autocomplete.html b/tests/unit/autocomplete/autocomplete.html index fa3527dac..90c8e8e97 100644 --- a/tests/unit/autocomplete/autocomplete.html +++ b/tests/unit/autocomplete/autocomplete.html @@ -4,32 +4,8 @@ <meta charset="utf-8"> <title>jQuery UI Autocomplete 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", "menu", "autocomplete" ], - js: [ - "ui/core.js", - "ui/widget.js", - "ui/position.js", - "ui/menu.js", - "ui/autocomplete.js" - ] - }); - </script> - - <script src="autocomplete_common.js"></script> - <script src="autocomplete_core.js"></script> - <script src="autocomplete_events.js"></script> - <script src="autocomplete_methods.js"></script> - <script src="autocomplete_options.js"></script> - - <script src="../swarminject.js"></script> + <script src="../../lib/css.js" data-modules="core menu autocomplete"></script> + <script src="../../lib/bootstrap.js" data-widget="autocomplete"></script> </head> <body> diff --git a/tests/unit/autocomplete/autocomplete_common.js b/tests/unit/autocomplete/autocomplete_common.js index b82ec1d1c..5ee7cdda0 100644 --- a/tests/unit/autocomplete/autocomplete_common.js +++ b/tests/unit/autocomplete/autocomplete_common.js @@ -1,4 +1,9 @@ -TestHelpers.commonWidgetTests( "autocomplete", { +define( [ + "lib/common", + "ui/autocomplete" +], function( common ) { + +common.testWidget( "autocomplete", { defaults: { appendTo: null, autoFocus: false, @@ -28,3 +33,5 @@ TestHelpers.commonWidgetTests( "autocomplete", { select: null } }); + +} ); diff --git a/tests/unit/autocomplete/autocomplete_core.js b/tests/unit/autocomplete/autocomplete_core.js index 4787011a1..d25328dd5 100644 --- a/tests/unit/autocomplete/autocomplete_core.js +++ b/tests/unit/autocomplete/autocomplete_core.js @@ -1,4 +1,7 @@ -(function( $ ) { +define( [ + "jquery", + "ui/autocomplete" +], function( $ ) { module( "autocomplete: core" ); @@ -395,4 +398,4 @@ asyncTest( "Search if the user retypes the same value (#7434)", function() { }); }); -}( jQuery ) ); +} ); diff --git a/tests/unit/autocomplete/autocomplete_events.js b/tests/unit/autocomplete/autocomplete_events.js index a7c366800..606562aa9 100644 --- a/tests/unit/autocomplete/autocomplete_events.js +++ b/tests/unit/autocomplete/autocomplete_events.js @@ -1,4 +1,7 @@ -(function( $ ) { +define( [ + "jquery", + "ui/autocomplete" +], function( $ ) { module( "autocomplete: events" ); @@ -179,4 +182,4 @@ asyncTest( "blur during remote search", function() { ac.val( "ro" ).keydown(); }); -}( jQuery ) ); +} ); diff --git a/tests/unit/autocomplete/autocomplete_methods.js b/tests/unit/autocomplete/autocomplete_methods.js index bbd016ff2..32080207a 100644 --- a/tests/unit/autocomplete/autocomplete_methods.js +++ b/tests/unit/autocomplete/autocomplete_methods.js @@ -1,10 +1,13 @@ -(function( $ ) { +define( [ + "jquery", + "ui/autocomplete" +], function( $ ) { module( "autocomplete: methods" ); -test( "destroy", function() { +test( "destroy", function( assert ) { expect( 1 ); - domEqual( "#autocomplete", function() { + assert.domEqual( "#autocomplete", function() { $( "#autocomplete" ).autocomplete().autocomplete( "destroy" ); }); }); @@ -42,4 +45,4 @@ test( "widget", function( assert ) { assert.hasClasses( widgetElement, "ui-menu" ); }); -}( jQuery ) ); +} ); diff --git a/tests/unit/autocomplete/autocomplete_options.js b/tests/unit/autocomplete/autocomplete_options.js index af9a424e9..a07a8d636 100644 --- a/tests/unit/autocomplete/autocomplete_options.js +++ b/tests/unit/autocomplete/autocomplete_options.js @@ -1,4 +1,7 @@ -(function( $ ) { +define( [ + "jquery", + "ui/autocomplete" +], function( $ ) { module( "autocomplete: options" ); @@ -311,4 +314,4 @@ test( "source, update after init", function() { equal( menu.find( ".ui-menu-item" ).text(), "php" ); }); -}( jQuery ) ); +} ); |