2 * mobile buttonMarkup tests
5 module("jquery.mobile.buttonMarkup.js");
7 test( "control group buttons should be enhanced inside a footer", function(){
10 group = $("#control-group-footer");
11 linkCount = group.find( "a" ).length;
13 same( group.find("a.ui-btn").length, linkCount, "all 4 links should be buttons");
14 same( group.find("a > span.ui-corner-left").length, 1, "only 1 left cornered button");
15 same( group.find("a > span.ui-corner-right").length, 1, "only 1 right cornered button");
16 same( group.find("a > span:not(.ui-corner-left):not(.ui-corner-right)").length, linkCount - 2, "only 2 buttons are cornered");
19 test( "control group buttons should respect theme-related data attributes", function(){
20 var group = $("#control-group-content");
22 ok(!group.find('[data-shadow=false]').hasClass("ui-shadow"),
23 "buttons with data-shadow=false should not have the ui-shadow class");
24 ok(!group.find('[data-corners=false]').hasClass("ui-btn-corner-all"),
25 "buttons with data-corners=false should not have the ui-btn-corner-all class");
26 ok(!group.find('[data-iconshadow=false] .ui-icon').hasClass("ui-icon-shadow"),
27 "buttons with data-iconshadow=false should not have the ui-icon-shadow class on their icons");
30 // Test for issue #3046 and #3054:
31 test( "mousedown on SVG elements should not throw an exception", function(){
32 var svg = $("#embedded-svg"),
35 ok(svg.length > 0, "found embedded svg document" );
36 if ( svg.length > 0 ) {
37 rect = $( "rect", svg );
38 ok(rect.length > 0, "found rect" );
40 rect.trigger("mousedown");
44 ok( success, "mousedown executed without exception");