diff --git a/tests/unit/buttonMarkup/buttonMarkup_core.js b/tests/unit/buttonMarkup/buttonMarkup_core.js index 53cb0532..ffca81a5 100644 --- a/tests/unit/buttonMarkup/buttonMarkup_core.js +++ b/tests/unit/buttonMarkup/buttonMarkup_core.js @@ -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); diff --git a/tests/unit/buttonMarkup/index.html b/tests/unit/buttonMarkup/index.html index c02d169a..70133aa8 100644 --- a/tests/unit/buttonMarkup/index.html +++ b/tests/unit/buttonMarkup/index.html @@ -39,6 +39,7 @@
+ No shadow No corners No shadow or corners