aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/data.js
diff options
context:
space:
mode:
authorTimmy Willison <timmywillisn@gmail.com>2016-01-07 16:50:26 -0500
committerTimmy Willison <timmywillisn@gmail.com>2016-01-07 16:50:59 -0500
commitc1511c673148208ab17cafa0faf37bce3b4ae392 (patch)
tree39558a632bf0c13d004d16239bccfc874a26fd36 /test/unit/data.js
parentb9a695865b4eb3916f7320026d028a2866da6e4e (diff)
downloadjquery-c1511c673148208ab17cafa0faf37bce3b4ae392.tar.gz
jquery-c1511c673148208ab17cafa0faf37bce3b4ae392.zip
Data: find hyphenated data with camelCased key
Fixes gh-2779
Diffstat (limited to 'test/unit/data.js')
-rw-r--r--test/unit/data.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/data.js b/test/unit/data.js
index 077362eda..00eb9b48e 100644
--- a/test/unit/data.js
+++ b/test/unit/data.js
@@ -878,3 +878,12 @@ QUnit.test( ".data(prop) does not create expando", function( assert ) {
}
}
} );
+
+QUnit.test( ".data(camelCase) retrieves hyphenated keys", function( assert ) {
+ assert.expect( 1 );
+
+ var div = jQuery( "<div/>" );
+
+ $.data( div[ 0 ], "data-test", "data" );
+ assert.equal( div.data( "dataTest" ), "data" );
+} );