diff options
author | Timmy Willison <timmywillisn@gmail.com> | 2015-11-30 11:30:31 -0500 |
---|---|---|
committer | Timmy Willison <timmywillisn@gmail.com> | 2015-12-02 10:39:02 -0500 |
commit | fbf829b7245f7d76ea02a44ab0a62427214b7575 (patch) | |
tree | 33b575fd1840f4b34aec0d5ff861d4f61f536cf5 /test | |
parent | 6680c1b29ea79bf33ac6bd31578755c7c514ed3e (diff) | |
download | jquery-fbf829b7245f7d76ea02a44ab0a62427214b7575.tar.gz jquery-fbf829b7245f7d76ea02a44ab0a62427214b7575.zip |
Attributes: exclusively lowercase A-Z in attribute names
Fixes gh-2730
Close gh-2749
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/attributes.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/unit/attributes.js b/test/unit/attributes.js index 9bf287688..cbf83d0ec 100644 --- a/test/unit/attributes.js +++ b/test/unit/attributes.js @@ -451,7 +451,9 @@ QUnit.test( "attr(String, Object)", function( assert ) { $radio = jQuery( "<input>", { "value": "sup", - "type": "radio" + // Use uppercase here to ensure the type + // attrHook is still used + "TYPE": "radio" } ).appendTo( "#testForm" ); assert.equal( $radio.val(), "sup", "Value is not reset when type is set after value on a radio" ); @@ -472,6 +474,15 @@ QUnit.test( "attr(String, Object)", function( assert ) { assert.equal( jQuery( "#name" ).attr( "nonexisting", undefined ).attr( "nonexisting" ), undefined, ".attr('attribute', undefined) does not create attribute (#5571)" ); } ); +QUnit.test( "attr(non-ASCII)", function( assert ) { + assert.expect( 2 ); + + var $div = jQuery( "<div Ω='omega' aØc='alpha'></div>" ).appendTo( "#qunit-fixture" ); + + assert.equal( $div.attr( "Ω" ), "omega", ".attr() exclusively lowercases characters in the range A-Z (gh-2730)" ); + assert.equal( $div.attr( "AØC" ), "alpha", ".attr() exclusively lowercases characters in the range A-Z (gh-2730)" ); +} ); + QUnit.test( "attr - extending the boolean attrHandle", function( assert ) { assert.expect( 1 ); var called = false, |