aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Broder-Rodgers <broder93@gmail.com>2016-12-24 10:33:27 +0000
committerRichard Gibson <richard.gibson@gmail.com>2016-12-29 15:02:12 -0500
commitbd9145fa15d91ab6c804161ecd892d4d08b71aa2 (patch)
tree2013a6ff73806e17ee8aa23252f1df532890e6fd /test
parentbf3a43eff8682b59cec785be6003753fa4b93706 (diff)
downloadjquery-bd9145fa15d91ab6c804161ecd892d4d08b71aa2.tar.gz
jquery-bd9145fa15d91ab6c804161ecd892d4d08b71aa2.zip
Tests: Added tests for symbol-separated tag names
Fixes gh-2006 Closes gh-3473
Diffstat (limited to 'test')
-rw-r--r--test/unit/core.js27
1 files changed, 18 insertions, 9 deletions
diff --git a/test/unit/core.js b/test/unit/core.js
index 2166576ec..312e20ad0 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -687,17 +687,26 @@ QUnit.test( "jQuery('html')", function( assert ) {
assert.equal( jQuery( "\\<div\\>" ).length, 0, "Ignore escaped html characters" );
} );
-QUnit.test( "jQuery(tag-hyphenated elements) gh-1987", function( assert ) {
- assert.expect( 17 );
+QUnit.test( "jQuery(element with non-alphanumeric name)", function( assert ) {
+ assert.expect( 36 );
+
+ jQuery.each( [ "-", ":" ], function( i, symbol ) {
+ jQuery.each( [ "thead", "tbody", "tfoot", "colgroup", "caption", "tr", "th", "td" ],
+ function( j, tag ) {
+ var tagName = tag + symbol + "test";
+ var el = jQuery( "<" + tagName + "></" + tagName + ">" );
+ assert.ok( el[ 0 ], "Create a " + tagName + " element" );
+ assert.ok( jQuery.nodeName( el[ 0 ], tagName.toUpperCase() ),
+ tagName + " element has expected node name" );
+ }
+ );
- jQuery.each( "thead tbody tfoot colgroup caption tr th td".split( " " ), function( i, name ) {
- var j = jQuery( "<" + name + "-d></" + name + "-d>" );
- assert.ok( j[ 0 ], "Create a tag-hyphenated elements" );
- assert.ok( jQuery.nodeName( j[ 0 ], name.toUpperCase() + "-D" ), "Tag-hyphenated element has expected node name" );
+ var tagName = [ "tr", "multiple", "symbol" ].join( symbol );
+ var el = jQuery( "<" + tagName + "></" + tagName + ">" );
+ assert.ok( el[ 0 ], "Create a " + tagName + " element" );
+ assert.ok( jQuery.nodeName( el[ 0 ], tagName.toUpperCase() ),
+ tagName + " element has expected node name" );
} );
-
- var j = jQuery( "<tr-multiple-hyphens></tr-multiple-hyphens>" );
- assert.ok( jQuery.nodeName( j[ 0 ], "TR-MULTIPLE-HYPHENS" ), "Element with multiple hyphens in its tag has expected node name" );
} );
QUnit.test( "jQuery('massive html #7990')", function( assert ) {