Permalink
Browse files

added new test for various ways of getting data attributes

  • Loading branch information...
DimitarChristoff committed Mar 31, 2012
1 parent 24e694b commit cee0d47ebbac3dfd6212da2fcee42bc3bcbbe0be
Showing with 6 additions and 0 deletions.
  1. +6 −0 test/tests/Element/Element.Data-test.js
@@ -38,6 +38,12 @@ buster.testCase("Data polyfill tests", {
buster.assert.isTrue(typeof data['placement'] == 'string' && typeof data['linkTitle'] == 'string');
},
+ "Expect .data('linkTitle') to equal .data('data-link-title') and .data('link-title')": function() {
+ var el = this.children[0];
+ el.data();
+ buster.assert.isTrue(el.data('linkTitle') == el.data('data-link-title') && el.data('linkTitle') == el.data('link-title'));
+ },
+
"Expect .data on the first element on an undefined property to be null": function() {
buster.assert.isNull(this.children[0].data('foo'));
},

0 comments on commit cee0d47

Please sign in to comment.