aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tabs/tabs_core.js
blob: 25e54c3ee18e53bf9b41f2c0e00dc28dc0d90f42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(function( $ ) {

module( "tabs: core" );

test( "markup structure", function() {
	expect( 3 );
	var el = $( "#tabs1" ).tabs();
	ok( el.hasClass( "ui-tabs" ), "main element is .ui-tabs" );
	ok( el.find( "ul" ).hasClass( "ui-tabs-nav" ), "list item is .ui-tabs-nav" );
	equal( el.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 el = $( selector ).tabs();
		ok( el.hasClass( "ui-tabs" ), "main element is .ui-tabs" );
		ok( $( selector + "-list" ).hasClass( "ui-tabs-nav" ),
			"list item is .ui-tabs-nav" );
	});
});

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

}( jQuery ) );