Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
ensure that the original event is included with beforenavigate
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbender committed Mar 4, 2013
1 parent fdc6a81 commit 068874d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/unit/navigation/event/event_core.js
Expand Up @@ -68,6 +68,23 @@ $.testHelper.setPushState();
location.hash = "bar";
});

asyncTest( "beforenavigate should carry the original navigation function", function() {

$( window ).one( "beforenavigate", function(event) {
var type = event.originalEvent.type;

if( $.support.pushState ) {
equal( type, "popstate", "the original event type is popstate" );
} else {
equal( type, "hashchange", "the original event type is hashchange" );
}

start();
});

location.hash = "beforenavigate";
});

if( $.support.pushState ) {
asyncTest( "popstate navigation events contain pushed state", function() {
$.testHelper.eventTarget = $( window );
Expand Down

0 comments on commit 068874d

Please sign in to comment.