mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-24 08:04:43 +00:00
Added unit tests for dialog theme inheritance.
This commit is contained in:
parent
d5cf4fc29a
commit
bf4db8dae1
2 changed files with 12 additions and 6 deletions
|
|
@ -14,10 +14,10 @@
|
|||
ok(/&ui-state=dialog/.test(location.hash), "ui-state=dialog =~ location.hash");
|
||||
|
||||
// Assert dialog theme inheritance (issue 1375):
|
||||
ok($('#foo-dialog').hasClass('ui-body-b'), 'Expected theme ui-body-b');
|
||||
ok($('#foo-dialog').find( ":jqmData(role=header)" ).hasClass('ui-bar-b'), 'Expected header theme inherited from parent ui-bar-b');
|
||||
ok($('#foo-dialog').find( ":jqmData(role=content)" ).hasClass('ui-body-b'), 'Expect content inheritance from dialog theme ui-body-b');
|
||||
ok($('#foo-dialog').find( ":jqmData(role=footer)" ).hasClass('ui-bar-c'), 'Expected footer theme ui-bar-c');
|
||||
ok($('#foo-dialog').hasClass('ui-body-b'), 'Expected explicit theme ui-body-b');
|
||||
ok($('#foo-dialog').find( ":jqmData(role=header)" ).hasClass('ui-bar-a'), 'Expected header to inherit from $.mobile.page.prototype.options.headerTheme');
|
||||
ok($('#foo-dialog').find( ":jqmData(role=content)" ).hasClass('ui-body-d'), 'Expect content to inherit from $.mobile.page.prototype.options.contentTheme');
|
||||
ok($('#foo-dialog').find( ":jqmData(role=footer)" ).hasClass('ui-bar-a'), 'Expected footer to inherit from $.mobile.page.prototype.options.footerTheme');
|
||||
|
||||
// close the dialog
|
||||
$(".ui-dialog").dialog("close");
|
||||
|
|
|
|||
|
|
@ -6,6 +6,12 @@
|
|||
<title>jQuery Mobile Dialog Test Suite</title>
|
||||
|
||||
<script src="../../../js/jquery.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="../../../js/"></script>
|
||||
<script src="../../../tests/jquery.testHelper.js"></script>
|
||||
|
|
@ -33,10 +39,10 @@
|
|||
<div data-nstest-role="header" data-nstest-position="inline">
|
||||
<h1>Dialog</h1>
|
||||
</div>
|
||||
<div data-nstest-role="content">
|
||||
<div data-nstest-role="content" >
|
||||
<a href="#" id="internal-link">foo</a>
|
||||
</div>
|
||||
<div data-nstest-role="footer" data-nstest-theme="c">
|
||||
<div data-nstest-role="footer">
|
||||
footer
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue