Tizen 2.0 Release
[platform/framework/web/web-ui-fw.git] / libs / js / jquery-mobile-1.2.0 / tests / unit / dialog / dialog_no_hash.js
1 /*
2  * mobile dialog unit tests
3  */
4 (function($) {
5         module( "jquery.mobile.dialog.js", {
6                 setup: function() {
7                         $.mobile.page.prototype.options.contentTheme = "d";
8                 }
9         });
10
11         asyncTest( "dialog opens and closes correctly when hash handling is off", function() {
12                 var activePage;
13
14                 expect( 3 );
15
16                 $.testHelper.pageSequence([
17                         function() {
18                                 $.mobile.changePage( $( "#mypage" ) );
19                         },
20
21                         function() {
22                                 activePage = $.mobile.activePage;
23                                 //bring up the dialog
24                                 $( "#dialog-no-hash-link" ).click();
25                         },
26
27                         function() {
28                                 // make sure the dialog came up
29                                 ok( $( "#dialog-no-hash" ).is( ":visible" ), "dialog showed up" );
30
31                                 // close the dialog
32                                 $( "#dialog-no-hash a" ).click();
33                         },
34
35                         function() {
36                                 ok( !$( "#dialog-no-hash" ).is( ":visible" ), "dialog disappeared" );
37                                 ok( $.mobile.activePage[0] === activePage[0], "active page has been restored" );
38                                 start();
39                         }
40                 ]);
41         });
42
43 })( jQuery );