Skip to content
Permalink
Browse files

Tabs: Convert tests to new infrastructure

Ref #10119
Ref gh-1528
  • Loading branch information...
scottgonzalez committed Apr 6, 2015
1 parent 31e36e6 commit 94f5c15df97ca975f039788f6220650492d924be
@@ -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;
@@ -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
}
});

} );
@@ -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 ) );
} );
@@ -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 ) );
} );
@@ -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 ) );
} );
@@ -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 ) );
} );
@@ -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 );
}
};

} );

0 comments on commit 94f5c15

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