Skip to content

Commit

Permalink
Failing test for mid-transition active checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanhammond committed Feb 27, 2018
1 parent 5b08deb commit dc7c598
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/router_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1593,6 +1593,27 @@ scenarios.forEach(function(scenario) {
showPost: showPostHandler,
};

// Check for mid-transition correctness.
// Get a reference to the transition, mid-transition.
router.willTransition = function() {
var midTransitionState = router.activeTransition.state;

// Make sure that the activeIntent doesn't match post 300.
var isPost300Targeted = router.isActiveIntent(
'showPost',
[300],
null,
midTransitionState
);
assert.notOk(isPost300Targeted, 'Post 300 should not match post 3.');
};

// Go to post 3. This triggers our test.
transitionTo(router, '/posts/3');

// Clean up.
delete router.willTransition;

transitionTo(router, '/posts/1');
assert.ok(router.isActive('showPost'), 'The showPost handler is active');
assert.ok(
Expand Down

0 comments on commit dc7c598

Please sign in to comment.