Skip to content

Commit 4380b63

Browse files
Add failing spec for #16921
1 parent b20e345 commit 4380b63

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

packages/ember/tests/routing/query_params_test.js

+27
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ moduleFor(
7373
);
7474

7575
return this.visit('/').then(() => {
76+
7677
assert.equal(appModelCount, 1, 'appModelCount is 1');
7778
assert.equal(indexModelCount, 1);
7879

@@ -629,6 +630,32 @@ moduleFor(
629630
});
630631
}
631632

633+
['@test GH#16921 transitioning works if both model and query params are supplied and refreshModel is true'](assert) {
634+
assert.expect(2);
635+
636+
this.router.map(function() {
637+
this.route('target', { path: 'target/:target_id' });
638+
});
639+
640+
this.add(
641+
'route:target',
642+
Route.extend({
643+
queryParams: {
644+
param1: {
645+
refreshModel: true,
646+
},
647+
},
648+
model() {},
649+
})
650+
);
651+
652+
return this.visitAndAssert('/').then(() => {
653+
let model = { id: '123' };
654+
this.transitionTo('target', model, { queryParams: { param1: 'new_param_value' }});
655+
this.assertCurrentPath('/target/123?param1=new_param_value');
656+
});
657+
}
658+
632659
['@test multiple QP value changes only cause a single model refresh'](assert) {
633660
assert.expect(2);
634661

0 commit comments

Comments
 (0)