From dc7c598c46d642affd2ec871540f862520ce2f36 Mon Sep 17 00:00:00 2001 From: Nathan Hammond Date: Mon, 26 Feb 2018 17:10:35 -0800 Subject: [PATCH] Failing test for mid-transition active checks. --- tests/router_test.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/router_test.js b/tests/router_test.js index 07b2d69b..7ae82b87 100644 --- a/tests/router_test.js +++ b/tests/router_test.js @@ -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(