From ba9d5a47e5a2afa7fb7a91d7ce800b319e45c495 Mon Sep 17 00:00:00 2001 From: Josh Dean Date: Wed, 18 Jan 2012 19:40:50 -0600 Subject: [PATCH] Added test for issue #3141 --- tests/unit/buttonMarkup/buttonMarkup_core.js | 16 ++++++++++++++++ tests/unit/buttonMarkup/index.html | 1 + 2 files changed, 17 insertions(+) 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 @@