Join GitHub today
Allow State.transitionTo handle multiple contexts #1354
Allows multiple contexts to be passed to
Added missing test coverage for transitionTo.
@trek Yep, looks like it is, shame we didn't see that first, would have saved us a while tracking it down!
There is test coverage for this one and a simpler implementation.
We've pushed again to solve the build issues.
@bestcroftington I was holding off to hear from Yehuda if my assumption about
The type checking is required because not all transitons are the result of user events, so sometimes the second argument is already an Ember object and sometimes that argument is stashed in an event that get's passed.
Multiple contexts need to passed as multiple arguments, not as a single array to work consistently ( i.e.
I should push my latest
@trek We've update the PR now and added in the type checking. We've also fixed the case where
It turns out that this also required some changes to
Now things like:
router.send('showComment', post, comment)
There is test coverage for each of the
referenced this pull request
Sep 14, 2012
@wagenet You suggest the following change
and then changing the type checking to
isn't this just hiding the dependency rather than removing it?
My issue with this relates to the tests. If the require of ember-views is removed then, in the test suite,
There are the tests we added that test the event code path:
I can't think of way that we can continue to test these whilst hiding the dependency on ember-views but please let me know if I am missing something.
Maybe it is worth considering what @trek and @drogus suggested and actually make it so that an event is never passed to
@crofty what this does is make it an "optional dependency". Basically, it says that if we have
The travis build is failing due to it not being able to find the ember-views that I am requiring in the test file.
@wagenet I'm definitely on board with this solution for removing ember views as a 'hard' dependency.
+1 to not passing a jQuery event into a transition as @trek suggested
Is there a use-case for passing an event to a transition? I would have assumed events should not be sent to transitions as you can write an action that both handles the event and invokes a transition.
There doesn't seem to be a way to specify a test suite only dependency, so I've removed the require of ember-views from the state package completely.
In order to test the code path that uses events, I've just stubbed
This PR should be good to go now.