From 5914b103627e3773418ad1fd8c3b034bf3748d51 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20Go=C5=82=C4=99biowski?= Date: Tue, 8 Sep 2015 18:43:08 +0200 Subject: [PATCH] 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. --- test/unit/basic.js | 48 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 5 deletions(-) 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" ); -- 2.39.5