Permalink
Browse files

Added test for issue #3141

  • Loading branch information...
1 parent a23f0d3 commit ba9d5a47e5a2afa7fb7a91d7ce800b319e45c495 Josh Dean committed with gseguin Jan 19, 2012
Showing with 17 additions and 0 deletions.
  1. +16 −0 tests/unit/buttonMarkup/buttonMarkup_core.js
  2. +1 −0 tests/unit/buttonMarkup/index.html
@@ -44,4 +44,20 @@
ok( success, "mousedown executed without exception");
}
});
+
+ // Test for issue #3141:
+ test( "elements of input[type='submit'] with data-role='button' should not be doubly enhanced", function(){
+ var button = $("#double-enhanced"),
+ count = 0;
+
+ button.bind('vclick', function() {
+ count++;
+ });
+
+ button.trigger('vclick');
+
+ ok( count === 1, "events don't trigger twice");
+
+ ok( !button.hasClass('ui-btn') && !button.children().length, "input not styled like button and contains no children");
+ });
})(jQuery);
@@ -39,6 +39,7 @@ <h2 id="qunit-userAgent"></h2>
<div data-nstest-role="page" id="default">
<div data-nstest-role="content" id="control-group-content">
+ <input type="submit" data-nstest-role="button" value="Double Enhanced?" id="double-enhanced" />
<a href="index.html" data-nstest-role="button" data-nstest-shadow="false">No shadow</a>
<a href="index.html" data-nstest-role="button" data-nstest-corners="false">No corners</a>
<a href="index.html" data-nstest-role="button" data-nstest-shadow="false" data-nstest-corners="false">No shadow or corners</a>

0 comments on commit ba9d5a4

Please sign in to comment.