]> source.dussan.org Git - jquery-ui.git/commitdiff
Tabs tests: Add tests for accessibility of ajax tabs.
authorScott González <scott.gonzalez@gmail.com>
Fri, 6 Jul 2012 00:49:00 +0000 (20:49 -0400)
committerScott González <scott.gonzalez@gmail.com>
Fri, 6 Jul 2012 00:49:00 +0000 (20:49 -0400)
tests/unit/tabs/tabs_core.js

index fd9cc7d63cf7373767fd49a2c5e03bd04fa86689..f1a2d72c1a79195b3e1b531f72ff5d743d16df21 100644 (file)
@@ -118,8 +118,24 @@ test( "accessibility", function() {
        equal( tabs.eq( 2 ).attr( "aria-disabled" ), "true", "disabled tab has aria-disabled=true" );
        equal( panels.eq( 2 ).attr( "aria-expanded" ), "false", "inactive panel has aria-expanded=false" );
        equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "inactive panel has aria-hidden=true" );
+});
 
-       // TODO: aria-live and aria-busy tests for ajax tabs
+asyncTest( "accessibility - ajax", function() {
+       expect( 4 );
+       var element = $( "#tabs2" ).tabs(),
+               tab = element.find( ".ui-tabs-nav li" ).eq( 3 ),
+               panel = $( "#custom-id" );
+
+       equal( panel.attr( "aria-live" ), "polite", "remote panel has aria-live" );
+       equal( panel.attr( "aria-busy" ), null, "does not have aria-busy on init" );
+       element.tabs( "option", "active", 3 );
+       equal( panel.attr( "aria-busy" ), "true", "panel has aria-busy during load" );
+       element.one( "tabsload", function() {
+               setTimeout(function() {
+                       equal( panel.attr( "aria-busy" ), null, "panel does not have aria-busy after load" );
+                       start();
+               }, 1 );
+       });
 });
 
 asyncTest( "keyboard support - LEFT, RIGHT, UP, DOWN, HOME, END, SPACE, ENTER", function() {