0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00
router/e2e/solid-router/basic-file-based/tests
Nico Lynzaad ecd79d2b63
fix(router-core): Non nested paths - only strip trailing underscore on route segments (#5182)
as part of #5169 we made changes to strip underscores from the paths to
ensure it is dealt with correctly during parsing.

inadvertently this stripped it from not only the route segments but also
the base segments. This PR resolves that issue by making
`baseParsePathName` aware which type of segments it is parsing.

a new optional boolean paramater, ```basePathValues```, is introduced in
`baseParsePathName` and `parsePathname` to allow this distinction
between routeSegments and/or basesegments to be passed on to
`baseParsePathName`.

2 new functions are introduced `parseBasePathSegments` and
`parseRoutePathSegments`, which is just wrapper functions around
`parsePathname`, but ensures clearer understanding of what set of
parsing instructions is applied and `basePathValues `is set correctly
based on the requirement.

updated the unit tests to take into account the need not to strip the
base values and also enhanced the e2e tests as well to ensure more
through testing with different usages.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- New Features
- Added non-nested route demos (named, prefix, suffix, path) with
index/foo/bar pages and updated navigation in React and Solid examples.
- Bug Fixes
- Improved path parsing/matching to handle non-nested segments,
prefixes/suffixes and trailing underscores; refined route
sorting/resolution.
- Tests
- Added comprehensive E2E coverage for non-nested paths; removed
obsolete baz-based tests.
- Expanded unit tests for path interpolation and matching (underscore,
prefix/suffix cases).
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
History 2025-09-22 03:12:27 +02:00
..
setup test(e2e): use locally hosted api over an external provider (#4725) 2025-07-22 00:15:28 +02:00
app.spec.ts fix(router-core): Non nested paths - only strip trailing underscore on route segments (#5182) 2025-09-22 03:12:27 +02:00
non-nested-paths.spec.ts fix(router-core): Non nested paths - only strip trailing underscore on route segments (#5182) 2025-09-22 03:12:27 +02:00
params.spec.ts fix(router-core): parse non-nested path params correctly (#5165) 2025-09-18 20:28:01 +02:00
redirect.spec.ts fix(router-core): Non-nested paths (#5169) 2025-09-19 01:05:26 +02:00
relative.spec.ts fix(react-router, solid-router): reduce useNavigate reactivity on path changes (#5037) 2025-08-31 13:48:25 +02:00
scroll-into-view.spec.ts feat(solid-router): Add a SolidJS driver for TanStack Router (#3276) 2025-02-20 17:11:39 +01:00
search-params.spec.ts fix: if validate search rewrites search params, issue a server-side redirect (#4439) 2025-06-16 19:57:42 +02:00