]> source.dussan.org Git - jquery-ui.git/commitdiff
Tests: Update `domEqual()` to work with jQuery git
authorScott González <scott.gonzalez@gmail.com>
Mon, 23 Mar 2015 22:37:03 +0000 (18:37 -0400)
committerScott González <scott.gonzalez@gmail.com>
Wed, 25 Mar 2015 19:55:12 +0000 (15:55 -0400)
jQuery now returns `null` for empty attributes instead of `undefined`.

Ref gh-1516

tests/unit/testsuite.js

index 175fadd971febef0d7f689fc35d59f88a3a7d86a..e03fd8f67a879e2228e59bea94ca55a86c23ce94 100644 (file)
@@ -305,11 +305,11 @@ window.domEqual = function( selector, modifier, message ) {
                        result = {};
                $.each( properties, function( index, attr ) {
                        var value = elem.prop( attr );
-                       result[ attr ] = value !== undefined ? value : "";
+                       result[ attr ] = value != null ? value : "";
                });
                $.each( attributes, function( index, attr ) {
                        var value = elem.attr( attr );
-                       result[ attr ] = value !== undefined ? value : "";
+                       result[ attr ] = value != null ? value : "";
                });
                result.style = getElementStyles( elem[ 0 ] );
                result.events = $._data( elem[ 0 ], "events" );