aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tabs/tabs_events.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-10-25 05:59:20 -0400
committerScott González <scott.gonzalez@gmail.com>2012-10-25 05:59:20 -0400
commit3d6c2a66d44a9283ad18e8c7c5ea701ddca82e59 (patch)
tree7a793a6341997cbc0bd4125fa8a85ff268e5b3ab /tests/unit/tabs/tabs_events.js
parent828b3c420cb42f02544b46bfa9208499a4947651 (diff)
downloadjquery-ui-3d6c2a66d44a9283ad18e8c7c5ea701ddca82e59.tar.gz
jquery-ui-3d6c2a66d44a9283ad18e8c7c5ea701ddca82e59.zip
Tabs: Removed back-compat for load event. Fixes #8731 - Tabs: Remove back-compat for load event.
Diffstat (limited to 'tests/unit/tabs/tabs_events.js')
-rw-r--r--tests/unit/tabs/tabs_events.js96
1 files changed, 47 insertions, 49 deletions
diff --git a/tests/unit/tabs/tabs_events.js b/tests/unit/tabs/tabs_events.js
index 57011bdad..f9b1755f7 100644
--- a/tests/unit/tabs/tabs_events.js
+++ b/tests/unit/tabs/tabs_events.js
@@ -253,16 +253,33 @@ test( "beforeLoad", function() {
equal( panel.html().toLowerCase(), "<p>testing</p>", "panel html after" );
});
-if ( $.uiBackCompat === false ) {
- asyncTest( "load", function() {
- expect( 21 );
+asyncTest( "load", function() {
+ expect( 21 );
- var tab, panelId, panel,
- element = $( "#tabs2" );
+ var tab, panelId, panel,
+ element = $( "#tabs2" );
+
+ // init
+ element.one( "tabsload", function( event, ui ) {
+ tab = element.find( ".ui-tabs-nav li" ).eq( 2 );
+ panelId = tab.attr( "aria-controls" );
+ panel = $( "#" + panelId );
+
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ equal( ui.tab.length, 1, "tab length" );
+ strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
+ equal( ui.panel.length, 1, "panel length" );
+ strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
+ equal( ui.panel.find( "p" ).length, 1, "panel html" );
+ state( element, 0, 0, 1, 0, 0 );
+ tabsload1();
+ });
+ element.tabs({ active: 2 });
- // init
+ function tabsload1() {
+ // .option()
element.one( "tabsload", function( event, ui ) {
- tab = element.find( ".ui-tabs-nav li" ).eq( 2 );
+ tab = element.find( ".ui-tabs-nav li" ).eq( 3 );
panelId = tab.attr( "aria-controls" );
panel = $( "#" + panelId );
@@ -272,49 +289,30 @@ if ( $.uiBackCompat === false ) {
equal( ui.panel.length, 1, "panel length" );
strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
equal( ui.panel.find( "p" ).length, 1, "panel html" );
- state( element, 0, 0, 1, 0, 0 );
- tabsload1();
+ state( element, 0, 0, 0, 1, 0 );
+ tabsload2();
});
- element.tabs({ active: 2 });
-
- function tabsload1() {
- // .option()
- element.one( "tabsload", function( event, ui ) {
- tab = element.find( ".ui-tabs-nav li" ).eq( 3 );
- panelId = tab.attr( "aria-controls" );
- panel = $( "#" + panelId );
-
- ok( !( "originalEvent" in event ), "originalEvent" );
- equal( ui.tab.length, 1, "tab length" );
- strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
- equal( ui.panel.length, 1, "panel length" );
- strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
- equal( ui.panel.find( "p" ).length, 1, "panel html" );
- state( element, 0, 0, 0, 1, 0 );
- tabsload2();
- });
- element.tabs( "option", "active", 3 );
- }
+ element.tabs( "option", "active", 3 );
+ }
- function tabsload2() {
- // click, change panel content
- element.one( "tabsload", function( event, ui ) {
- tab = element.find( ".ui-tabs-nav li" ).eq( 4 );
- panelId = tab.attr( "aria-controls" );
- panel = $( "#" + panelId );
-
- equal( event.originalEvent.type, "click", "originalEvent" );
- equal( ui.tab.length, 1, "tab length" );
- strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
- equal( ui.panel.length, 1, "panel length" );
- strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
- equal( ui.panel.find( "p" ).length, 1, "panel html" );
- state( element, 0, 0, 0, 0, 1 );
- start();
- });
- element.find( ".ui-tabs-nav .ui-tabs-anchor" ).eq( 4 ).click();
- }
- });
-}
+ function tabsload2() {
+ // click, change panel content
+ element.one( "tabsload", function( event, ui ) {
+ tab = element.find( ".ui-tabs-nav li" ).eq( 4 );
+ panelId = tab.attr( "aria-controls" );
+ panel = $( "#" + panelId );
+
+ equal( event.originalEvent.type, "click", "originalEvent" );
+ equal( ui.tab.length, 1, "tab length" );
+ strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
+ equal( ui.panel.length, 1, "panel length" );
+ strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
+ equal( ui.panel.find( "p" ).length, 1, "panel html" );
+ state( element, 0, 0, 0, 0, 1 );
+ start();
+ });
+ element.find( ".ui-tabs-nav .ui-tabs-anchor" ).eq( 4 ).click();
+ }
+});
}( jQuery ) );