mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Tests: Handle jQuery git returning null
for empty attributes
jQuery now returns `null` for empty attributes instead of `undefined`. Closes gh-1516
This commit is contained in:
parent
e109e76819
commit
899d90709a
@ -127,11 +127,11 @@ test( "outerHeight(true) - setter", function() {
|
||||
test( "uniqueId / removeUniqueId", function() {
|
||||
expect( 3 );
|
||||
var el = $( "img" ).eq( 0 );
|
||||
strictEqual( el.attr( "id" ), undefined, "element has no initial id" );
|
||||
equal( el.attr( "id" ), null, "element has no initial id" );
|
||||
el.uniqueId();
|
||||
ok( /ui-id-\d+$/.test( el.attr( "id" ) ), "element has generated id" );
|
||||
el.removeUniqueId();
|
||||
strictEqual( el.attr( "id" ), undefined, "unique id has been removed from element" );
|
||||
equal( el.attr( "id" ), null, "unique id has been removed from element" );
|
||||
});
|
||||
|
||||
})( jQuery );
|
||||
|
@ -78,7 +78,7 @@ test( "ARIA", function() {
|
||||
element.remove();
|
||||
|
||||
element = $("<div><div aria-describedby='section2'><p id='section2'>descriotion</p></div></div>").dialog();
|
||||
strictEqual( element.dialog( "widget" ).attr( "aria-describedby" ), undefined, "no aria-describedby added, as already present in markup" );
|
||||
equal( element.dialog( "widget" ).attr( "aria-describedby" ), null, "no aria-describedby added, as already present in markup" );
|
||||
element.remove();
|
||||
});
|
||||
|
||||
|
@ -107,11 +107,11 @@ test( "{ role: null }", function( assert ) {
|
||||
}),
|
||||
items = element.find( "li" );
|
||||
expect( 2 + 3 * items.length );
|
||||
strictEqual( element.attr( "role" ), undefined );
|
||||
equal( element.attr( "role" ), null );
|
||||
ok( items.length > 0, "number of menu items" );
|
||||
items.each(function( item ) {
|
||||
assert.hasClasses( $( this ), "ui-menu-item" );
|
||||
equal( $( this ).find( ".ui-menu-item-wrapper" ).attr( "role" ), undefined,
|
||||
equal( $( this ).find( ".ui-menu-item-wrapper" ).attr( "role" ), null,
|
||||
"menu item ("+ item + ") role" );
|
||||
equal( $( this ).find( ".ui-menu-item-wrapper" ).attr( "tabindex" ), "-1",
|
||||
"tabindex for menu item ("+ item + ")" );
|
||||
|
@ -55,7 +55,7 @@ test( "accessibility", function() {
|
||||
element.progressbar( "option", "value", false );
|
||||
equal( element.attr( "aria-valuemin" ), 0, "aria-valuemin" );
|
||||
equal( element.attr( "aria-valuemax" ), 150, "aria-valuemax" );
|
||||
strictEqual( element.attr( "aria-valuenow" ), undefined, "aria-valuenow" );
|
||||
equal( element.attr( "aria-valuenow" ), null, "aria-valuenow" );
|
||||
});
|
||||
|
||||
}( jQuery ) );
|
||||
|
@ -38,8 +38,7 @@ test( "accessibility", function() {
|
||||
equal( element.attr( "aria-describedby" ), "fixture-span " + tooltipId,
|
||||
"multiple describedby when open" );
|
||||
|
||||
// strictEqual to distinguish between .removeAttr( "title" ) and .attr( "title", "" )
|
||||
strictEqual( element.attr( "title" ), undefined, "no title when open" );
|
||||
equal( element.attr( "title" ), null, "no title when open" );
|
||||
equal( liveRegion.children().length, 1 );
|
||||
equal( liveRegion.children().last().html(), "..." );
|
||||
element.tooltip( "close" );
|
||||
|
@ -70,7 +70,7 @@ test( "enable/disable", function( assert ) {
|
||||
assert.lacksClasses( element.tooltip( "widget" ), "ui-state-disabled" );
|
||||
ok( !element.tooltip( "widget" ).attr( "aria-disabled" ), "element doesn't get aria-disabled" );
|
||||
assert.lacksClasses( element.tooltip( "widget" ), "ui-tooltip-disabled" );
|
||||
strictEqual( tooltip.attr( "title" ), undefined, "title removed on disable" );
|
||||
equal( tooltip.attr( "title" ), null, "title removed on disable" );
|
||||
|
||||
element.tooltip( "open" );
|
||||
equal( $( ".ui-tooltip" ).length, 0, "open does nothing when disabled" );
|
||||
|
Loading…
Reference in New Issue
Block a user