Skip to content

Commit

Permalink
Added test for issue jquery-archive#3141
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Dean authored and gseguin committed Jan 19, 2012
1 parent a23f0d3 commit ba9d5a4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/unit/buttonMarkup/buttonMarkup_core.js
Expand Up @@ -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);
1 change: 1 addition & 0 deletions tests/unit/buttonMarkup/index.html
Expand Up @@ -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>
Expand Down

0 comments on commit ba9d5a4

Please sign in to comment.