Skip to content

Commit 899d907

Browse files
committed
Tests: Handle jQuery git returning null for empty attributes
jQuery now returns `null` for empty attributes instead of `undefined`. Closes gh-1516
1 parent e109e76 commit 899d907

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

tests/unit/core/core.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ test( "outerHeight(true) - setter", function() {
127127
test( "uniqueId / removeUniqueId", function() {
128128
expect( 3 );
129129
var el = $( "img" ).eq( 0 );
130-
strictEqual( el.attr( "id" ), undefined, "element has no initial id" );
130+
equal( el.attr( "id" ), null, "element has no initial id" );
131131
el.uniqueId();
132132
ok( /ui-id-\d+$/.test( el.attr( "id" ) ), "element has generated id" );
133133
el.removeUniqueId();
134-
strictEqual( el.attr( "id" ), undefined, "unique id has been removed from element" );
134+
equal( el.attr( "id" ), null, "unique id has been removed from element" );
135135
});
136136

137137
})( jQuery );

tests/unit/dialog/dialog_core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ test( "ARIA", function() {
7878
element.remove();
7979

8080
element = $("<div><div aria-describedby='section2'><p id='section2'>descriotion</p></div></div>").dialog();
81-
strictEqual( element.dialog( "widget" ).attr( "aria-describedby" ), undefined, "no aria-describedby added, as already present in markup" );
81+
equal( element.dialog( "widget" ).attr( "aria-describedby" ), null, "no aria-describedby added, as already present in markup" );
8282
element.remove();
8383
});
8484

tests/unit/menu/menu_options.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ test( "{ role: null }", function( assert ) {
107107
}),
108108
items = element.find( "li" );
109109
expect( 2 + 3 * items.length );
110-
strictEqual( element.attr( "role" ), undefined );
110+
equal( element.attr( "role" ), null );
111111
ok( items.length > 0, "number of menu items" );
112112
items.each(function( item ) {
113113
assert.hasClasses( $( this ), "ui-menu-item" );
114-
equal( $( this ).find( ".ui-menu-item-wrapper" ).attr( "role" ), undefined,
114+
equal( $( this ).find( ".ui-menu-item-wrapper" ).attr( "role" ), null,
115115
"menu item ("+ item + ") role" );
116116
equal( $( this ).find( ".ui-menu-item-wrapper" ).attr( "tabindex" ), "-1",
117117
"tabindex for menu item ("+ item + ")" );

tests/unit/progressbar/progressbar_core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ test( "accessibility", function() {
5555
element.progressbar( "option", "value", false );
5656
equal( element.attr( "aria-valuemin" ), 0, "aria-valuemin" );
5757
equal( element.attr( "aria-valuemax" ), 150, "aria-valuemax" );
58-
strictEqual( element.attr( "aria-valuenow" ), undefined, "aria-valuenow" );
58+
equal( element.attr( "aria-valuenow" ), null, "aria-valuenow" );
5959
});
6060

6161
}( jQuery ) );

tests/unit/tooltip/tooltip_core.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ test( "accessibility", function() {
3838
equal( element.attr( "aria-describedby" ), "fixture-span " + tooltipId,
3939
"multiple describedby when open" );
4040

41-
// strictEqual to distinguish between .removeAttr( "title" ) and .attr( "title", "" )
42-
strictEqual( element.attr( "title" ), undefined, "no title when open" );
41+
equal( element.attr( "title" ), null, "no title when open" );
4342
equal( liveRegion.children().length, 1 );
4443
equal( liveRegion.children().last().html(), "..." );
4544
element.tooltip( "close" );

tests/unit/tooltip/tooltip_methods.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ test( "enable/disable", function( assert ) {
7070
assert.lacksClasses( element.tooltip( "widget" ), "ui-state-disabled" );
7171
ok( !element.tooltip( "widget" ).attr( "aria-disabled" ), "element doesn't get aria-disabled" );
7272
assert.lacksClasses( element.tooltip( "widget" ), "ui-tooltip-disabled" );
73-
strictEqual( tooltip.attr( "title" ), undefined, "title removed on disable" );
73+
equal( tooltip.attr( "title" ), null, "title removed on disable" );
7474

7575
element.tooltip( "open" );
7676
equal( $( ".ui-tooltip" ).length, 0, "open does nothing when disabled" );

0 commit comments

Comments
 (0)