Sha256: 0ff77779410adee5f4052bc7f845781fcd1e8f4c17eae915cb08f45abe951561

Contents?: true

Size: 1.48 KB

Versions: 8

Compression:

Stored size: 1.48 KB

Contents

(function( $ ) {

module( "tabs: core" );

test( "markup structure", function() {
	expect( 3 );
	var element = $( "#tabs1" ).tabs();
	ok( element.hasClass( "ui-tabs" ), "main element is .ui-tabs" );
	ok( element.find( "ul" ).hasClass( "ui-tabs-nav" ), "list item is .ui-tabs-nav" );
	equal( element.find( ".ui-tabs-panel" ).length, 3,
		".ui-tabs-panel elements exist, correct number" );
});

$.each({
	"deep ul": "#tabs3",
	"multiple lists, ul first": "#tabs4",
	"multiple lists, ol first": "#tabs5",
	"empty list": "#tabs6"
}, function( type, selector ) {
	test( "markup structure: " + type, function() {
		expect( 2 );
		var element = $( selector ).tabs();
		ok( element.hasClass( "ui-tabs" ), "main element is .ui-tabs" );
		ok( $( selector + "-list" ).hasClass( "ui-tabs-nav" ),
			"list item is .ui-tabs-nav" );
	});
});

test( "aria-controls", function() {
	expect( 7 );
	var element = $( "#tabs1" ).tabs(),
		tabs = element.find( ".ui-tabs-nav a" );
	tabs.each(function() {
		var tab = $( this );
		equal( tab.attr( "href" ).substring( 1 ), tab.attr( "aria-controls" ) );
	});

	element = $( "#tabs2" ).tabs();
	tabs = element.find( ".ui-tabs-nav a" );
	equal( tabs.eq( 0 ).attr( "aria-controls" ), "colon:test" );
	equal( tabs.eq( 1 ).attr( "aria-controls" ), "inline-style" );
	ok( /^ui-tabs-\d+$/.test( tabs.eq( 2 ).attr( "aria-controls" ) ), "generated id" );
	equal( tabs.eq( 3 ).attr( "aria-controls" ), "custom-id" );
});

test( "accessibility", function() {
	// TODO: add tests
});

}( jQuery ) );

Version data entries

8 entries across 7 versions & 1 rubygems

Version Path
survivalkit-0.3.4 templates/project/sources/jquery-ui/tests/unit/tabs/tabs_core.js
survivalkit-0.3.3 templates/project/sources/jquery-ui/tests/unit/tabs/tabs_core.js
survivalkit-0.3.3 templates/drupal/sources/jquery-ui/tests/unit/tabs/tabs_core.js
survivalkit-0.3.2 templates/project/sources/jquery-ui/tests/unit/tabs/tabs_core.js
survivalkit-0.3.1 templates/project/sources/jquery-ui/tests/unit/tabs/tabs_core.js
survivalkit-0.3 templates/project/sources/jquery-ui/tests/unit/tabs/tabs_core.js
survivalkit-0.2.1 templates/project/sources/jquery-ui/tests/unit/tabs/tabs_core.js
survivalkit-0.1 templates/project/sources/jquery-ui/tests/unit/tabs/tabs_core.js