diff --git a/packages/@ember/-internals/glimmer/lib/components/link-to.ts b/packages/@ember/-internals/glimmer/lib/components/link-to.ts index 1376eba4ba3..a1d8267bb60 100644 --- a/packages/@ember/-internals/glimmer/lib/components/link-to.ts +++ b/packages/@ember/-internals/glimmer/lib/components/link-to.ts @@ -517,7 +517,8 @@ const LinkComponent = EmberComponent.extend({ _route: computed('route', '_currentRouterState', function computeLinkToComponentRoute(this: any) { let { route } = this; - return this._namespaceRoute(route === UNDEFINED ? this._currentRoute : route); + + return route === UNDEFINED ? this._currentRoute : this._namespaceRoute(route); }), _models: computed('model', 'models', function computeLinkToComponentModels(this: any) { diff --git a/packages/@ember/-internals/glimmer/tests/integration/application/engine-test.js b/packages/@ember/-internals/glimmer/tests/integration/application/engine-test.js index 5104cc5591d..2ceadc86064 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/application/engine-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/application/engine-test.js @@ -890,6 +890,25 @@ moduleFor( }); } + '@test query params only transitions work properly'(assert) { + assert.expect(1); + + let tmpl = 'News'; + + this.setupAppAndRoutableEngine(); + this.additionalEngineRegistrations(function () { + this.register('template:category', compile(tmpl)); + }); + + return this.visit('/blog/category/1').then(() => { + let suffix = '/blog/category/1?type=news'; + let href = this.element.querySelector('a').href; + + // check if link ends with the suffix + assert.ok(this.stringsEndWith(href, suffix)); + }); + } + async ['@test query params in customized controllerName have stickiness by default between model']( assert ) {