diff options
Diffstat (limited to 'test/unit/css.js')
-rw-r--r-- | test/unit/css.js | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/test/unit/css.js b/test/unit/css.js index b6bb95584..4533e4692 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -1316,22 +1316,23 @@ QUnit[ jQuery.find.compile ? "test" : "skip" ]( ":visible/:hidden selectors", fu } ); QUnit.test( "Keep the last style if the new one isn't recognized by the browser (#14836)", function( assert ) { - assert.expect( 2 ); + assert.expect( 1 ); - var el; - el = jQuery( "<div></div>" ).css( "position", "absolute" ).css( "position", "fake value" ); + var el = jQuery( "<div></div>" ).css( "position", "absolute" ).css( "position", "fake value" ); assert.equal( el.css( "position" ), "absolute", "The old style is kept when setting an unrecognized value" ); - el = jQuery( "<div></div>" ).css( "position", "absolute" ).css( "position", " " ); - - // Support: Edge 14 - // Edge collapses whitespace-only values when setting a style property and - // there is no easy way for us to work around it. Just skip the test there - // and hope for the better future. - if ( /edge\//i.test( navigator.userAgent ) ) { - assert.ok( true, "Skipped (Edge 14 handles whitespace-only values incorrectly)" ); - } else { - assert.equal( el.css( "position" ), "absolute", "The old style is kept when setting to a space" ); - } +} ); + +// Support: Edge 14 - 15 +// Edge collapses whitespace-only values when setting a style property and +// there is no easy way for us to work around it. Just skip the test there +// and hope for the better future. +QUnit[ /\bedge\//i.test( navigator.userAgent ) ? "skip" : "test" ]( + "Keep the last style if the new one is a non-empty whitespace (gh-3204)", + function( assert ) { + assert.expect( 1 ); + + var el = jQuery( "<div></div>" ).css( "position", "absolute" ).css( "position", " " ); + assert.equal( el.css( "position" ), "absolute", "The old style is kept when setting to a space" ); } ); QUnit.test( "Reset the style if set to an empty string", function( assert ) { |