Optimistic Routing Test

This test verifies that route prediction works correctly. When a route pattern is learned from one URL, navigating to a different URL with the same pattern should show the loading state instantly.

Basic Dynamic Route

Nested Dynamic Route

Optional Catch-All Route

Required Catch-All Route

Static Route with Catch-All Sibling

Tests that navigating to a sub-route of a static path does not incorrectly match the catch-all sibling at the parent level.

Static Sibling Detection

Rewrite Detection (Route Params)

These URLs are rewritten by proxy to /actual/[slug]. The route should be marked as having a dynamic rewrite since the URL doesn't match the route structure.

Rewrite Detection (Prefetch Misprediction)

/products/promo/[id] is rewritten to /products/sale/[id]. The rewrite preserves the /products/[category]/[id] shape, so a pattern learned from a non-rewritten product URL will match and mispredict category as "promo". The prefetch response must detect the mismatch and mark the pattern instead of rendering the wrong params.

Rewrite Detection (Search Params)

These URLs are rewritten based on search params. /search-rewrite?v=X becomes /rewrite-target?content=X. Since the page is static, if we incorrectly use a cached pattern, we'd show wrong content.