Skip to content

Commit 5914b10

Browse files
committed
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.
1 parent 855b0c8 commit 5914b10

File tree

1 file changed

+43
-5
lines changed

1 file changed

+43
-5
lines changed

test/unit/basic.js

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,31 @@ QUnit.test( "manipulation", function( assert ) {
179179
elem2 = jQuery( "<div/>" ).appendTo( "#qunit-fixture" );
180180

181181
assert.strictEqual( elem1.text( "foo" ).text(), "foo", ".html getter/setter" );
182-
assert.strictEqual( elem1.html( "<span/>" ).html(), "<span></span>", ".html getter/setter" );
182+
183+
assert.strictEqual(
184+
185+
// Support: IE 8 only
186+
// IE 8 prints tag names in upper case.
187+
elem1.html( "<span/>" ).html().toLowerCase(),
188+
"<span></span>",
189+
".html getter/setter"
190+
);
183191

184192
assert.strictEqual( elem1.append( elem2 )[ 0 ].childNodes[ 1 ], elem2[ 0 ], ".append" );
185193
assert.strictEqual( elem1.prepend( elem2 )[ 0 ].childNodes[ 0 ], elem2[ 0 ], ".prepend" );
186194

187195
child = elem1.find( "span" );
188196
child.after( "<a/>" );
189197
child.before( "<b/>" );
190-
assert.strictEqual( elem1.html(), "<div></div><b></b><span></span><a></a>", ".after/.before" );
198+
199+
assert.strictEqual(
200+
201+
// Support: IE 8 only
202+
// IE 8 prints tag names in upper case.
203+
elem1.html(),
204+
"<div></div><b></b><span></span><a></a>",
205+
".after/.before"
206+
);
191207
} );
192208

193209
QUnit.test( "offset", function( assert ) {
@@ -251,12 +267,34 @@ QUnit.test( "wrap", function( assert ) {
251267
var elem = jQuery( "<div><a><b></b></a><a></a></div>" );
252268

253269
elem.find( "b" ).wrap( "<span>" );
254-
assert.strictEqual( elem.html(), "<a><span><b></b></span></a><a></a>", ".wrap" );
270+
271+
assert.strictEqual(
272+
273+
// Support: IE 8 only
274+
// IE 8 prints tag names in upper case.
275+
elem.html().toLowerCase(),
276+
"<a><span><b></b></span></a><a></a>",
277+
".wrap"
278+
);
279+
255280
elem.find( "span" ).wrapInner( "<em>" );
256-
assert.strictEqual( elem.html(), "<a><span><em><b></b></em></span></a><a></a>", ".wrapInner" );
281+
282+
assert.strictEqual(
283+
284+
// Support: IE 8 only
285+
// IE 8 prints tag names in upper case.
286+
elem.html().toLowerCase(),
287+
"<a><span><em><b></b></em></span></a><a></a>",
288+
".wrapInner"
289+
);
290+
257291
elem.find( "a" ).wrapAll( "<i>" );
292+
258293
assert.strictEqual(
259-
elem.html(),
294+
295+
// Support: IE 8 only
296+
// IE 8 prints tag names in upper case.
297+
elem.html().toLowerCase(),
260298
"<i><a><span><em><b></b></em></span></a><a></a></i>",
261299
".wrapAll"
262300
);

0 commit comments

Comments
 (0)