Permalink
Browse files

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.
  • Loading branch information...
mgol committed Sep 8, 2015
1 parent 855b0c8 commit 5914b103627e3773418ad1fd8c3b034bf3748d51
Showing with 43 additions and 5 deletions.
  1. +43 −5 test/unit/basic.js
View
@@ -179,15 +179,31 @@ 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" );
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"
);

0 comments on commit 5914b10

Please sign in to comment.