Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
added a failing unit test for issue #3276 - support for data-role="di…
Browse files Browse the repository at this point in the history
…alog"
  • Loading branch information
scottjehl committed Feb 23, 2012
1 parent ec3e602 commit 522543e
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/unit/dialog/dialog_count.js
@@ -0,0 +1,13 @@
/*
* mobile dialog unit tests
*/
(function($) {

test( "When the page loads, any dialogs in the page should be initialized", function() {
expect( 1 );

ok( $( "#foo-dialog" ).is( ".ui-dialog-page" ), "When a dialog is the first element in a page, it is created as a dialog widget." );
});


})( jQuery );
63 changes: 63 additions & 0 deletions tests/unit/dialog/index-count.html
@@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery Mobile Dialog Test Suite</title>
<script src="../../../external/requirejs/require.js"></script>
<script src="../../../js/jquery.tag.inserter.js"></script>
<script>
$(document).bind('mobileinit',function(){
// Expect content to inherit this theme when not explicitly set
$.mobile.page.prototype.options.contentTheme = "d";
});
</script>
<script src="../jquery.setNameSpace.js"></script>
<script src="../../jquery.testHelper.js"></script>
<script src="../../../external/qunit.js"></script>
<script>
$.testHelper.asyncLoad([
[
"jquery.mobile.dialog",
"jquery.mobile.page",
"jquery.mobile.page.sections"
],
[ "jquery.mobile.init" ],
[
"dialog_count.js"
]
]);
</script>


<link rel="stylesheet" href="../../../css/themes/default/jquery.mobile.css"/>
<link rel="stylesheet" href="../../../external/qunit.css"/>

<script src="../swarminject.js"></script>
</head>
<body>

<h1 id="qunit-header">jQuery Mobile Dialog Test Suite</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests">
</ol>

<div id="qunit-fixture">

<div id="foo-dialog" data-nstest-role="dialog" data-nstest-theme="b">
<div data-nstest-role="header">
<h1>Dialog</h1>
</div>
<div data-nstest-role="content" >

</div>
<div data-nstest-role="footer">
footer
</div>
</div>

</div>

</body>
</html>

0 comments on commit 522543e

Please sign in to comment.