Added test for issue #3141

This commit is contained in:
Josh Dean 2012-01-18 19:40:50 -06:00 committed by Ghislain Seguin
parent a23f0d3a0e
commit ba9d5a47e5
2 changed files with 17 additions and 0 deletions

View file

@ -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);

View file

@ -39,6 +39,7 @@
<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>