jquery-mobile/tests/unit/dialog/dialog_events.js
2011-03-26 15:01:25 -04:00

24 lines
592 B
JavaScript

/*
* mobile dialog unit tests
*/
(function($){
module('jquery.mobile.dialog.js');
asyncTest( "dialog hash is added when the dialog is opened and removed when closed", function(){
expect( 2 );
//bring up the dialog
$("a[href='#foo-dialog']").click();
setTimeout(function(){
ok(/&ui-state=dialog/.test(location.hash), "ui-state=dialog =~ location.hash");
// close the dialog
$(".ui-dialog").dialog("close");
}, 500);
setTimeout(function(){
ok(!/&ui-state=dialog/.test(location.hash), "ui-state=dialog !~ location.hash");
start();
}, 1000);
});
})(jQuery);