diff --git a/lib/router/router.ts b/lib/router/router.ts index 5de1b895..00e6c708 100644 --- a/lib/router/router.ts +++ b/lib/router/router.ts @@ -229,9 +229,9 @@ export default abstract class Router { } if (isIntermediate) { - let transition = new InternalTransition(this, undefined, undefined); + let transition = new InternalTransition(this, undefined, newState); this.toReadOnlyInfos(transition, newState); - this.setupContexts(newState); + this.setupContexts(newState, transition); this.routeWillChange(transition); return this.activeTransition!; diff --git a/tests/router_test.ts b/tests/router_test.ts index 5a5e7858..42ed9294 100644 --- a/tests/router_test.ts +++ b/tests/router_test.ts @@ -5379,7 +5379,7 @@ scenarios.forEach(function (scenario) { }); test('intermediateTransitionTo() has the correct RouteInfo objects', function (assert) { - assert.expect(5); + assert.expect(6); routes = { application: createHandler('application'), foo: createHandler('foo', { @@ -5400,6 +5400,8 @@ scenarios.forEach(function (scenario) { enteredCount++; } else if (enteredCount === 1) { assert.equal(transition.to!.name, 'loading', 'entering'); + // https://github.com/emberjs/ember.js/issues/14438 + assert.equal(transition[STATE_SYMBOL].routeInfos.length, 2, 'with routeInfos present'); enteredCount++; } else { assert.equal(transition.to!.name, 'foo', 'back to');