Skip to content

Commit

Permalink
Merge branch 'master' into menubar
Browse files Browse the repository at this point in the history
Conflicts:
	ui/jquery.ui.menu.js
  • Loading branch information
jzaefferer committed Apr 26, 2011
2 parents f7d2fdb + 325ee6e commit cd61fb1
Show file tree
Hide file tree
Showing 37 changed files with 600 additions and 772 deletions.
172 changes: 0 additions & 172 deletions tests/static/menu/all-menus-icons.html

This file was deleted.

39 changes: 0 additions & 39 deletions tests/static/menu/default.html

This file was deleted.

2 changes: 1 addition & 1 deletion tests/unit/accordion/accordion.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<script src="../testsuite.js"></script>

<script>
function state( accordion ) {
function accordion_state( accordion ) {
var expected = $.makeArray( arguments ).slice( 1 );
var actual = accordion.find( ".ui-accordion-content" ).map(function() {
return $( this ).css( "display" ) === "none" ? 0 : 1;
Expand Down
28 changes: 14 additions & 14 deletions tests/unit/accordion/accordion_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,46 @@ module( "accordion: core", accordionSetupTeardown() );

$.each( { div: "#list1", ul: "#navigation", dl: "#accordion-dl" }, function( type, selector ) {
test( "markup structure: " + type, function() {
var ac = $( selector ).accordion();
ok( ac.hasClass( "ui-accordion" ), "main element is .ui-accordion" );
equal( ac.find( ".ui-accordion-header" ).length, 3,
var element = $( selector ).accordion();
ok( element.hasClass( "ui-accordion" ), "main element is .ui-accordion" );
equal( element.find( ".ui-accordion-header" ).length, 3,
".ui-accordion-header elements exist, correct number" );
equal( ac.find( ".ui-accordion-content" ).length, 3,
equal( element.find( ".ui-accordion-content" ).length, 3,
".ui-accordion-content elements exist, correct number" );
same( ac.find( ".ui-accordion-header" ).next().get(),
ac.find( ".ui-accordion-content" ).get(),
same( element.find( ".ui-accordion-header" ).next().get(),
element.find( ".ui-accordion-content" ).get(),
"content panels come immediately after headers" );
});
});

test( "handle click on header-descendant", function() {
var ac = $( "#navigation" ).accordion();
var element = $( "#navigation" ).accordion();
$( "#navigation h2:eq(1) a" ).click();
state( ac, 0, 1, 0 );
accordion_state( element, 0, 1, 0 );
});

test( "ui-accordion-heading class added to headers anchor", function() {
expect( 1 );
var ac = $( "#list1" ).accordion();
var anchors = $( ".ui-accordion-heading" );
var element = $( "#list1" ).accordion();
var anchors = element.find( ".ui-accordion-heading" );
equals( anchors.length, 3 );
});

test( "accessibility", function () {
expect( 13 );
var ac = $( "#list1" ).accordion().accordion( "option", "active", 1 );
var headers = $( ".ui-accordion-header" );
var element = $( "#list1" ).accordion().accordion( "option", "active", 1 );
var headers = element.find( ".ui-accordion-header" );

equals( headers.eq( 1 ).attr( "tabindex" ), 0, "active header should have tabindex=0" );
equals( headers.eq( 0 ).attr( "tabindex" ), -1, "inactive header should have tabindex=-1" );
equals( ac.attr( "role" ), "tablist", "main role" );
equals( element.attr( "role" ), "tablist", "main role" );
equals( headers.attr( "role" ), "tab", "tab roles" );
equals( headers.next().attr( "role" ), "tabpanel", "tabpanel roles" );
equals( headers.eq( 1 ).attr( "aria-expanded" ), "true", "active tab has aria-expanded" );
equals( headers.eq( 0 ).attr( "aria-expanded" ), "false", "inactive tab has aria-expanded" );
equals( headers.eq( 1 ).attr( "aria-selected" ), "true", "active tab has aria-selected" );
equals( headers.eq( 0 ).attr( "aria-selected" ), "false", "inactive tab has aria-selected" );
ac.accordion( "option", "active", 0 );
element.accordion( "option", "active", 0 );
equals( headers.eq( 0 ).attr( "aria-expanded" ), "true", "newly active tab has aria-expanded" );
equals( headers.eq( 1 ).attr( "aria-expanded" ), "false", "newly inactive tab has aria-expanded" );
equals( headers.eq( 0 ).attr( "aria-selected" ), "true", "active tab has aria-selected" );
Expand Down
7 changes: 6 additions & 1 deletion tests/unit/accordion/accordion_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ commonWidgetTests( "accordion", {
icons: {
"activeHeader": "ui-icon-triangle-1-s",
"header": "ui-icon-triangle-1-e"
}
},

// callbacks
activate: null,
beforeActivate: null,
create: null
}
});
9 changes: 8 additions & 1 deletion tests/unit/accordion/accordion_defaults_deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ commonWidgetTests( "accordion", {
"headerSelected": "ui-icon-triangle-1-s"
},
navigation: false,
navigationFilter: function() {}
navigationFilter: function() {},

// callbacks
activate: null,
beforeActivate: null,
change: null,
changestart: null,
create: null
}
});
2 changes: 1 addition & 1 deletion tests/unit/accordion/accordion_deprecated.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<script src="../testsuite.js"></script>

<script>
function state( accordion ) {
function accordion_state( accordion ) {
var expected = $.makeArray( arguments ).slice( 1 );
var actual = accordion.find( ".ui-accordion-content" ).map(function() {
return $( this ).css( "display" ) === "none" ? 0 : 1;
Expand Down
Loading

0 comments on commit cd61fb1

Please sign in to comment.