From: Michał Gołębiowski Date: Tue, 8 Sep 2015 16:43:08 +0000 (+0200) Subject: Tests: Make basic tests work in IE 8 X-Git-Tag: 2.2.0~145 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5914b103627e3773418ad1fd8c3b034bf3748d51;p=jquery.git Tests: Make basic tests work in IE 8 IE 8 prints tag names in upper case which was breaking some tests. This commit is not necessary on master but has been brought here to keep tests similar in both branches. --- diff --git a/test/unit/basic.js b/test/unit/basic.js index 3f4806ea0..b1b9205ce 100644 --- a/test/unit/basic.js +++ b/test/unit/basic.js @@ -179,7 +179,15 @@ QUnit.test( "manipulation", function( assert ) { elem2 = jQuery( "
" ).appendTo( "#qunit-fixture" ); assert.strictEqual( elem1.text( "foo" ).text(), "foo", ".html getter/setter" ); - assert.strictEqual( elem1.html( "" ).html(), "", ".html getter/setter" ); + + assert.strictEqual( + + // Support: IE 8 only + // IE 8 prints tag names in upper case. + elem1.html( "" ).html().toLowerCase(), + "", + ".html getter/setter" + ); assert.strictEqual( elem1.append( elem2 )[ 0 ].childNodes[ 1 ], elem2[ 0 ], ".append" ); assert.strictEqual( elem1.prepend( elem2 )[ 0 ].childNodes[ 0 ], elem2[ 0 ], ".prepend" ); @@ -187,7 +195,15 @@ QUnit.test( "manipulation", function( assert ) { child = elem1.find( "span" ); child.after( "" ); child.before( "" ); - assert.strictEqual( elem1.html(), "
", ".after/.before" ); + + assert.strictEqual( + + // Support: IE 8 only + // IE 8 prints tag names in upper case. + elem1.html(), + "
", + ".after/.before" + ); } ); QUnit.test( "offset", function( assert ) { @@ -251,12 +267,34 @@ QUnit.test( "wrap", function( assert ) { var elem = jQuery( "
" ); elem.find( "b" ).wrap( "" ); - assert.strictEqual( elem.html(), "", ".wrap" ); + + assert.strictEqual( + + // Support: IE 8 only + // IE 8 prints tag names in upper case. + elem.html().toLowerCase(), + "", + ".wrap" + ); + elem.find( "span" ).wrapInner( "" ); - assert.strictEqual( elem.html(), "", ".wrapInner" ); + + assert.strictEqual( + + // Support: IE 8 only + // IE 8 prints tag names in upper case. + elem.html().toLowerCase(), + "", + ".wrapInner" + ); + elem.find( "a" ).wrapAll( "" ); + assert.strictEqual( - elem.html(), + + // Support: IE 8 only + // IE 8 prints tag names in upper case. + elem.html().toLowerCase(), "", ".wrapAll" );