Fix/check childRoutes in getRoute#903
Conversation
ericmarcos
left a comment
There was a problem hiding this comment.
Sorry, I think I didn't explain well the desired behaviour.
When the router gets a "path payolad", that is, a payload in the format __PATH_PAYLOAD__<path> (for example __PATH_PAYLOAD__initial/step-2) this means that we should ignore lastRoutePath value and simply return the route identified by .
The 3 tests that were skipped shouldn't be changed, they reflect the intended behaviour (notice how you changed the 3rd test to match this implementation).
I think the solution could be very simple: just at the beginning of the processInput function, check if we're dealing with a "path payload" (__PATH_PAYLOAD__<path>) and just go find that ignoring the lastRoutePath. We already have a function getRouteByPath that I think you could reuse. Else, just leave the rest of logic as is.
bdc2d0f to
9eb18ff
Compare
Remember to tag the PR with WIP tag if it's not ready to be merged.
Reference
Description
The function
getRoutenow checks if the input matches with a childRouteContext
Some tests of
botonic/corewere failing because the functiongetRoutewasn't checking the childRoutesApproach taken / Explain the design
Call
getRouterecursively to check if the input matches with a childRouteTo documentate / Usage example
Testing
The pull request...