-
Notifications
You must be signed in to change notification settings - Fork 971
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
Make MockRouter also map private routes. #820
Conversation
|
||
const FakePage = () => <></> | ||
|
||
describe('MockRouter', () => { |
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.
Yaaay, tests!
export * from '@redwoodjs/router/dist/index' | ||
|
||
export const routes: { [routeName: string]: () => string } = {} | ||
|
||
const getPrivateRoutes = (children: React.ReactNode) => |
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.
Do you expect any other nested type of routes in the Router in the (near) future? If so it could be worthwhile to make the function recursively look for routes?
If not, ignore me!
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 don't think so, we really want to keep it flat, but this might be a great place to adopt the @redwoodjs/structure
's implementation instead of duplicating it across Routers.
Fix
MockRouter
not correctly mappingRoutes
nested inPrivate
.