Skip to content
Source
Sign inSign up
TanStack/router

test: reproduce circular route module references #8877

Openbeaussan(GitHub profile, opens in a new tab)wants to merge 1 commit intomonorepo fromcodex/route-module-circular-referencesopened

Showing 10 changed files with 30 additions and 12 deletions (loading 6).

x
0 of 10 viewed, 10 left
11 additions and 0 deletionse2e/react-router/route-modules/e2e/circular-references.spec.tsAdded
View file
@@ -0,0 +1,11 @@
+import { expect } from '@playwright/test'
+import { test } from '@tanstack/router-e2e-utils'
+​
+test('account and products link to each other', async ({ page }) => {
+ await page.goto('/account')
+ await page.getByRole('link', { name: 'Last viewed product' }).click()
+ await expect(page).toHaveURL('/shop/products/last-viewed?tab=reviews')
+ await page.getByRole('link', { name: 'All products' }).click()
+ await page.getByRole('link', { name: 'My last order' }).click()
+ await expect(page).toHaveURL('/account/orders/1')
+})
3 additions and 1 deletione2e/react-router/route-modules/packages/account/tsconfig.route-types.jsonModified
View file
@@ -2,6 +2,7 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": false,
+ "composite": true,
"declaration": true,
"emitDeclarationOnly": true,
"noEmitOnError": true,
@@ -9,5 +10,6 @@
"rootDir": ".",
"outDir": ".tanstack/types"
},
- "include": ["src"]
+ "include": ["src"],
+ "references": [{ "path": "../products/tsconfig.route-types.json" }]