Skip to content

Commit a93cdbc

Browse files
author
scottjehl
committed
changed up the unit test so that it didn't load the page in an iframe, which seemed to mess things up on the test server.
1 parent 03f3272 commit a93cdbc

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

tests/unit/init/init_core.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,7 @@
211211
start();
212212
}, 500);
213213
});
214-
215-
asyncTest( "page element is generated when not present in initial markup", function(){
216-
expect( 1 );
217-
218-
$("<iframe src='nopage.html'>").appendTo("body").load(function(){
219-
ok( $(this).contents().find( ".ui-page" ).length, 1 );
220-
$(this).remove();
221-
start();
222-
});
223-
});
214+
224215

225216
asyncTest( "page element is generated when not present in ajax'd markup", function(){
226217
expect( 1 );

tests/unit/init/init_core_nopage.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* mobile init tests
3+
*/
4+
(function($){
5+
6+
7+
test( "page element is generated when not present in initial markup", function(){
8+
ok( $( ".ui-page" ).length, 1 );
9+
});
10+
11+
12+
})(jQuery);

tests/unit/init/nopage.html

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,27 @@
33
<head>
44
<meta charset="UTF-8" />
55
<title>jQuery Mobile Init Test Suite</title>
6+
<!-- meta viewport left out on purpose for test append -->
67
<script src="../../../js/jquery.js"></script>
78
<script src="../jquery.setNameSpace.js"></script>
89
<script src="../../../js/"></script>
9-
10+
<script src="../../../external/qunit.js"></script>
11+
<script src="../../jquery.testHelper.js"></script>
12+
<script src="init_core_nopage.js"></script>
13+
<link rel="stylesheet" href="../../../themes/default" />
14+
<link rel="stylesheet" href="../../../external/qunit.css"/>
15+
<style>
16+
[data-nstest-role="page"], [data-nstest-role="dialog"] {
17+
position: static !important;
18+
}
19+
</style>
1020
</head>
1121

12-
<p>testing</p>
22+
<h1 id="qunit-header">jQuery Mobile Init Test Suite</h1>
23+
<h2 id="qunit-banner"></h2>
24+
<h2 id="qunit-userAgent"></h2>
25+
<ol id="qunit-tests">
26+
</ol>
1327

1428
</body>
1529
</html>

0 commit comments

Comments
 (0)