diff options
author | Scott González <scott.gonzalez@gmail.com> | 2015-04-06 15:01:13 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2015-04-09 09:26:27 -0400 |
commit | 94f5c15df97ca975f039788f6220650492d924be (patch) | |
tree | e4a74b9b0c0cb872a7ceb849deec544527e93b21 /tests/unit | |
parent | 31e36e6ae4e1552b9a79595695c13dce4f416d0b (diff) | |
download | jquery-ui-94f5c15df97ca975f039788f6220650492d924be.tar.gz jquery-ui-94f5c15df97ca975f039788f6220650492d924be.zip |
Tabs: Convert tests to new infrastructure
Ref #10119
Ref gh-1528
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/tabs/tabs.html | 27 | ||||
-rw-r--r-- | tests/unit/tabs/tabs_common.js | 9 | ||||
-rw-r--r-- | tests/unit/tabs/tabs_core.js | 10 | ||||
-rw-r--r-- | tests/unit/tabs/tabs_events.js | 10 | ||||
-rw-r--r-- | tests/unit/tabs/tabs_methods.js | 22 | ||||
-rw-r--r-- | tests/unit/tabs/tabs_options.js | 14 | ||||
-rw-r--r-- | tests/unit/tabs/tabs_test_helpers.js | 6 |
7 files changed, 51 insertions, 47 deletions
diff --git a/tests/unit/tabs/tabs.html b/tests/unit/tabs/tabs.html index e2bccec99..6d52a2490 100644 --- a/tests/unit/tabs/tabs.html +++ b/tests/unit/tabs/tabs.html @@ -4,31 +4,8 @@ <meta charset="utf-8"> <title>jQuery UI Tabs 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", "tabs" ], - js: [ - "ui/core.js", - "ui/widget.js", - "ui/tabs.js" - ] - }); - </script> - - <script src="tabs_test_helpers.js"></script> - <script src="tabs_common.js"></script> - <script src="tabs_core.js"></script> - <script src="tabs_events.js"></script> - <script src="tabs_methods.js"></script> - <script src="tabs_options.js"></script> - - <script src="../swarminject.js"></script> + <script src="../../lib/css.js" data-modules="core tabs"></script> + <script src="../../lib/bootstrap.js" data-widget="tabs"></script> <style> #tabs8, #tabs8 * { margin: 0; diff --git a/tests/unit/tabs/tabs_common.js b/tests/unit/tabs/tabs_common.js index c43d8ff09..d3aa5cd48 100644 --- a/tests/unit/tabs/tabs_common.js +++ b/tests/unit/tabs/tabs_common.js @@ -1,4 +1,9 @@ -TestHelpers.commonWidgetTests( "tabs", { +define( [ + "lib/common", + "ui/tabs" +], function( common ) { + +common.testWidget( "tabs", { defaults: { active: null, classes: { @@ -22,3 +27,5 @@ TestHelpers.commonWidgetTests( "tabs", { load: null } }); + +} ); diff --git a/tests/unit/tabs/tabs_core.js b/tests/unit/tabs/tabs_core.js index 881571f5d..c7eb23704 100644 --- a/tests/unit/tabs/tabs_core.js +++ b/tests/unit/tabs/tabs_core.js @@ -1,6 +1,10 @@ -(function( $ ) { +define( [ + "jquery", + "./tabs_test_helpers", + "ui/tabs" +], function( $, tabsTestHelpers ) { -var state = TestHelpers.tabs.state; +var state = tabsTestHelpers.state; module( "tabs: core" ); @@ -660,4 +664,4 @@ test( "#4033 - IE expands hash to full url and misinterprets tab as ajax", funct state( element, 1 ); }); -}( jQuery ) ); +} ); diff --git a/tests/unit/tabs/tabs_events.js b/tests/unit/tabs/tabs_events.js index f9b1755f7..b5972242d 100644 --- a/tests/unit/tabs/tabs_events.js +++ b/tests/unit/tabs/tabs_events.js @@ -1,6 +1,10 @@ -(function( $ ) { +define( [ + "jquery", + "./tabs_test_helpers", + "ui/tabs" +], function( $, tabsTestHelpers ) { -var state = TestHelpers.tabs.state; +var state = tabsTestHelpers.state; module( "tabs: events" ); @@ -315,4 +319,4 @@ asyncTest( "load", function() { } }); -}( jQuery ) ); +} ); diff --git a/tests/unit/tabs/tabs_methods.js b/tests/unit/tabs/tabs_methods.js index b9b5bee9f..cd4ed3581 100644 --- a/tests/unit/tabs/tabs_methods.js +++ b/tests/unit/tabs/tabs_methods.js @@ -1,23 +1,27 @@ -(function( $ ) { +define( [ + "jquery", + "./tabs_test_helpers", + "ui/tabs" +], function( $, tabsTestHelpers ) { -var disabled = TestHelpers.tabs.disabled, - state = TestHelpers.tabs.state; +var disabled = tabsTestHelpers.disabled, + state = tabsTestHelpers.state; module( "tabs: methods" ); -test( "destroy", function() { +test( "destroy", function( assert ) { expect( 2 ); - domEqual( "#tabs1", function() { + assert.domEqual( "#tabs1", function() { $( "#tabs1" ).tabs().tabs( "destroy" ); }); - domEqual( "#tabs2", function() { + assert.domEqual( "#tabs2", function() { $( "#tabs2" ).tabs().tabs( "destroy" ); }); }); -asyncTest( "destroy - ajax", function() { +asyncTest( "destroy - ajax", function( assert ) { expect( 1 ); - domEqual( "#tabs2", function( done ) { + assert.domEqual( "#tabs2", function( done ) { var element = $( "#tabs2" ).tabs({ load: function() { setTimeout(function() { @@ -283,4 +287,4 @@ test( "widget", function() { strictEqual( widgetElement[ 0 ], element[ 0 ], "same element" ); }); -}( jQuery ) ); +} ); diff --git a/tests/unit/tabs/tabs_options.js b/tests/unit/tabs/tabs_options.js index 572ce3c20..13b88b040 100644 --- a/tests/unit/tabs/tabs_options.js +++ b/tests/unit/tabs/tabs_options.js @@ -1,8 +1,12 @@ -(function( $ ) { +define( [ + "jquery", + "./tabs_test_helpers", + "ui/tabs" +], function( $, tabsTestHelpers ) { -var disabled = TestHelpers.tabs.disabled, - equalHeight = TestHelpers.tabs.equalHeight, - state = TestHelpers.tabs.state; +var disabled = tabsTestHelpers.disabled, + equalHeight = tabsTestHelpers.equalHeight, + state = tabsTestHelpers.state; module( "tabs: options" ); @@ -367,4 +371,4 @@ asyncTest( "hide and show - animation", function() { element.tabs( "option", "active", 1 ); }); -}( jQuery ) ); +} ); diff --git a/tests/unit/tabs/tabs_test_helpers.js b/tests/unit/tabs/tabs_test_helpers.js index 1be90f8fe..8d35c31db 100644 --- a/tests/unit/tabs/tabs_test_helpers.js +++ b/tests/unit/tabs/tabs_test_helpers.js @@ -1,4 +1,6 @@ -TestHelpers.tabs = { +define( function() { + +return { disabled: function( tabs, state ) { var expected, actual, internalState = tabs.tabs( "option", "disabled" ); @@ -64,3 +66,5 @@ TestHelpers.tabs = { deepEqual( actual, expected ); } }; + +} ); |