aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2015-09-08 18:43:08 +0200
committerMichał Gołębiowski <m.goleb@gmail.com>2015-09-08 18:46:15 +0200
commitf709a284e2ae343d9425a567a663ccd7adcd21d0 (patch)
treebb5cb9b2218ac6989372473be568021190cf49ce
parent06454d118f506baa351995c2a0337cba72ce5787 (diff)
downloadjquery-f709a284e2ae343d9425a567a663ccd7adcd21d0.tar.gz
jquery-f709a284e2ae343d9425a567a663ccd7adcd21d0.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. (cherry-picked from 5914b103627e3773418ad1fd8c3b034bf3748d51)
-rw-r--r--test/unit/basic.js48
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"
);