Skip to content

Commit 8c31d5c

Browse files
committed
added control group enhancement tests, still needs other footer button enhancement tests
1 parent 6529dc7 commit 8c31d5c

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* mobile buttonMarkup tests
3+
*/
4+
(function($){
5+
module("jquery.mobile.buttonMarkup.js");
6+
7+
test( "control group buttons should be enhanced inside a footer", function(){
8+
var group, linkCount;
9+
10+
group = $("#control-group-footer");
11+
linkCount = group.find( "a" ).length;
12+
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");
17+
});
18+
})(jQuery);

tests/unit/buttonMarkup/index.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>jQuery Mobile Button Markup Test Suite</title>
6+
<!-- meta viewport left out on purpose for test append -->
7+
<script src="../../../js/jquery.js"></script>
8+
<script src="../../../js/"></script>
9+
<script src="../../../external/qunit.js"></script>
10+
<script src="../../jquery.testHelper.js"></script>
11+
<script src="buttonMarkup_core.js"></script>
12+
13+
<link rel="stylesheet" href="../../../themes/default" />
14+
<link rel="stylesheet" href="../../../external/qunit.css"/>
15+
</head>
16+
<body>
17+
18+
<h1 id="qunit-header">jQuery Mobile Button Markup Test Suite</h1>
19+
<h2 id="qunit-banner"></h2>
20+
<h2 id="qunit-userAgent"></h2>
21+
<ol id="qunit-tests">
22+
</ol>
23+
24+
<div data-nstest-role="page" id="default">
25+
<div data-role="footer" id="control-group-footer" class="ui-bar" data-position="inline">
26+
<div data-role="controlgroup" data-type="horizontal">
27+
<a href="index.html" data-icon="delete">Remove</a>
28+
<a href="index.html" data-icon="plus">Add</a>
29+
<a href="index.html" data-icon="arrow-u">Up</a>
30+
<a href="index.html" data-icon="arrow-d">Down</a>
31+
</div>
32+
</div>
33+
</div>
34+
</body>
35+
</html>

0 commit comments

Comments
 (0)