Skip to content

Commit

Permalink
[BUGFIX beta] Failing test for #17869
Browse files Browse the repository at this point in the history
  • Loading branch information
chancancode committed Apr 6, 2019
1 parent 8d19759 commit 1cff9f1
Showing 1 changed file with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ moduleFor(
'{{link-to}} component with query params (routing)',
class extends ApplicationTestCase {
constructor() {
super();
super(...arguments);
let indexProperties = {
foo: '123',
bar: 'abc',
Expand Down Expand Up @@ -736,5 +736,36 @@ moduleFor(
this.shouldBeActive(assert, '#foos-link');
});
}

['@test [GH#17869] it does not cause shadowing assertion with `hash` local variable']() {
this.router.map(function() {
this.route('post', { path: '/post/:id' });
});

this.add(
'controller:post',
Controller.extend({
queryParams: ['showComments'],
showComments: true,
})
);

this.addTemplate(
'index',
`
{{#let (hash id="1" title="Hello World!" body="Lorem ipsum dolor sit amet...") as |hash|}}
{{#link-to "post" hash (query-params showComments=false)}}View Post{{/link-to}}
{{/let}}
`
);

return this.visit('/').then(() => {
this.assertComponentElement(this.element.firstElementChild, {
tagName: 'a',
attrs: { href: '/post/1?showComments=false', class: classMatcher('ember-view') },
content: 'View Post',
});
});
}
}
);

0 comments on commit 1cff9f1

Please sign in to comment.