-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUGFIX beta] exempt routes that share a controller from duplicate assertion #14791
Conversation
@trentmwillis mind reviewing to ensure fix is in right direction? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this!
|
||
if (qpsByUrlKey[urlKey]) { | ||
if (qpOther && (qpOther.hasOwnProperty('controllerName') && qpOther.controllerName !== qp.controllerName)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure the hasOwnProperty
check here is necessary. Ideally if a collision happens, and the property isn't there then we should do the assertion.
@@ -255,3 +255,57 @@ QUnit.test('Router#triggerEvent ignores handlers that have not loaded yet', func | |||
|
|||
triggerEvent(handlerInfos, false, ['loading']); | |||
}); | |||
|
|||
QUnit.test('Router#_queryParamsFor returns the cached leaf handler when present', function(assert) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather these tests be done as acceptance-type tests rather than unit tests. They should probably go in this test file which does the other collision checks: https://github.com/emberjs/ember.js/blob/master/packages/ember/tests/routing/query_params_test/overlapping_query_params_test.js
thanks for the feedback; will be updating here within the morning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small thing, otherwise seems good to me. Will need a review from an actual maintainer though.
@@ -105,7 +106,20 @@ moduleFor('Query Params - overlapping query param property names', class extends | |||
this.assertCurrentPath('/parent/child?childPage=3&parentPage=4'); | |||
}); | |||
} | |||
['@test query params does not error when a query parameter exists for route instances that share a controller'](assert) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Need a newline before and after the test block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
OK, I squashed, rebased, and updated commit message. Will merge once Travis is green... |
thanks @trentmwillis and @rwjblue ! |
start of fix for #14560