Skip to content
Browse files

moved finicky hashchange test to sequence helper to prevent overlap w…

…ith setting the hash
  • Loading branch information...
1 parent d426588 commit 9729dc9f15da499d816ebb3723390a2bc1027f83 @johnbender johnbender committed Jun 27, 2011
Showing with 17 additions and 8 deletions.
  1. +17 −8 tests/unit/init/init_core.js
View
25 tests/unit/init/init_core.js
@@ -120,14 +120,23 @@
});
asyncTest( "hashchange triggered on document ready with single argument: true", function(){
- $(window).one("hashchange", function(ev, arg){
- same(arg, true);
- start();
- });
-
- // a hash must be set to guarantee the trigger
- location.hash = "#foo";
- $.testHelper.reloadLib(libName);
+ $.testHelper.sequence([
+ function(){
+ location.hash = "#foo";
+ },
+
+ // delay the bind until the first hashchange
+ function(){
+ $(window).one("hashchange", function(ev, arg){
+ same(arg, true);
+ start();
+ });
+ },
+
+ function(){
+ $.testHelper.reloadLib(libName);
+ }
+ ], 1000);
});
test( "pages without a data-url attribute have it set to their id", function(){

0 comments on commit 9729dc9

Please sign in to comment.
Something went wrong with that request. Please try again.