diff options
author | Michał Gołębiowski <m.goleb@gmail.com> | 2015-09-08 18:43:08 +0200 |
---|---|---|
committer | Michał Gołębiowski <m.goleb@gmail.com> | 2015-09-08 18:43:08 +0200 |
commit | 5914b103627e3773418ad1fd8c3b034bf3748d51 (patch) | |
tree | e22d5e19e638818798f843260f44919dd749ca97 /test/unit/basic.js | |
parent | 855b0c8c288533948b257925a8906f7da3449eed (diff) | |
download | jquery-5914b103627e3773418ad1fd8c3b034bf3748d51.tar.gz jquery-5914b103627e3773418ad1fd8c3b034bf3748d51.zip |
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.
Diffstat (limited to 'test/unit/basic.js')
-rw-r--r-- | test/unit/basic.js | 48 |
1 files 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( "<div/>" ).appendTo( "#qunit-fixture" ); assert.strictEqual( elem1.text( "foo" ).text(), "foo", ".html getter/setter" ); - assert.strictEqual( elem1.html( "<span/>" ).html(), "<span></span>", ".html getter/setter" ); + + assert.strictEqual( + + // Support: IE 8 only + // IE 8 prints tag names in upper case. + elem1.html( "<span/>" ).html().toLowerCase(), + "<span></span>", + ".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( "<a/>" ); child.before( "<b/>" ); - assert.strictEqual( elem1.html(), "<div></div><b></b><span></span><a></a>", ".after/.before" ); + + assert.strictEqual( + + // Support: IE 8 only + // IE 8 prints tag names in upper case. + elem1.html(), + "<div></div><b></b><span></span><a></a>", + ".after/.before" + ); } ); QUnit.test( "offset", function( assert ) { @@ -251,12 +267,34 @@ QUnit.test( "wrap", function( assert ) { var elem = jQuery( "<div><a><b></b></a><a></a></div>" ); elem.find( "b" ).wrap( "<span>" ); - assert.strictEqual( elem.html(), "<a><span><b></b></span></a><a></a>", ".wrap" ); + + assert.strictEqual( + + // Support: IE 8 only + // IE 8 prints tag names in upper case. + elem.html().toLowerCase(), + "<a><span><b></b></span></a><a></a>", + ".wrap" + ); + elem.find( "span" ).wrapInner( "<em>" ); - assert.strictEqual( elem.html(), "<a><span><em><b></b></em></span></a><a></a>", ".wrapInner" ); + + assert.strictEqual( + + // Support: IE 8 only + // IE 8 prints tag names in upper case. + elem.html().toLowerCase(), + "<a><span><em><b></b></em></span></a><a></a>", + ".wrapInner" + ); + elem.find( "a" ).wrapAll( "<i>" ); + assert.strictEqual( - elem.html(), + + // Support: IE 8 only + // IE 8 prints tag names in upper case. + elem.html().toLowerCase(), "<i><a><span><em><b></b></em></span></a><a></a></i>", ".wrapAll" ); |