(initialHistory?: RouterHistory)
| 1137 | |
| 1138 | describe('router.navigate navigation using optional path parameters - edge cases and validations', () => { |
| 1139 | function createEdgeCaseTestRouter(initialHistory?: RouterHistory) { |
| 1140 | const history = |
| 1141 | initialHistory ?? createMemoryHistory({ initialEntries: ['/'] }) |
| 1142 | |
| 1143 | const rootRoute = createRootRoute({}) |
| 1144 | const indexRoute = createRoute({ |
| 1145 | getParentRoute: () => rootRoute, |
| 1146 | path: '/', |
| 1147 | }) |
| 1148 | |
| 1149 | // Route with prefix/suffix |
| 1150 | const filesRoute = createRoute({ |
| 1151 | getParentRoute: () => rootRoute, |
| 1152 | path: '/files/prefix{-$name}.txt', |
| 1153 | }) |
| 1154 | |
| 1155 | // Route with all optional params |
| 1156 | const dateRoute = createRoute({ |
| 1157 | getParentRoute: () => rootRoute, |
| 1158 | path: '/date/{-$year}/{-$month}/{-$day}', |
| 1159 | }) |
| 1160 | |
| 1161 | const routeTree = rootRoute.addChildren([indexRoute, filesRoute, dateRoute]) |
| 1162 | const router = createRouter({ routeTree, history }) |
| 1163 | |
| 1164 | return { router } |
| 1165 | } |
| 1166 | |
| 1167 | it('should handle optional parameters with prefix/suffix correctly', async () => { |
| 1168 | const { router } = createEdgeCaseTestRouter( |
no test coverage detected