-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
stabilize rsc tests #7217
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
stabilize rsc tests #7217
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { expect, type Page } from '@playwright/test' | ||
|
|
||
| export async function waitForHydration(page: Page) { | ||
| await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated', { | ||
| timeout: 15000, | ||
| }) | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,6 @@ | ||||||||||||||||
| import { expect } from '@playwright/test' | ||||||||||||||||
| import { test } from '@tanstack/router-e2e-utils' | ||||||||||||||||
| import { waitForHydration } from './hydration' | ||||||||||||||||
| const DEFERRED_DATA_TIMEOUT = 5000 // Deferred data takes ~2 seconds | ||||||||||||||||
|
Comment on lines
+3
to
4
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix lint error: add a blank line after imports. Line 3 is currently followed by a declaration on Line 4, which violates Suggested fix import { expect } from '@playwright/test'
import { test } from '@tanstack/router-e2e-utils'
import { waitForHydration } from './hydration'
+
const DEFERRED_DATA_TIMEOUT = 5000 // Deferred data takes ~2 seconds📝 Committable suggestion
Suggested change
🧰 Tools🪛 ESLint[error] 3-3: Expected 1 empty line after import statement not followed by another import. (import/newline-after-import) 🤖 Prompt for AI Agents |
||||||||||||||||
|
|
||||||||||||||||
| test.describe('RSC Deferred Tests - RSC with streamed Promise data', () => { | ||||||||||||||||
|
|
@@ -64,7 +65,7 @@ test.describe('RSC Deferred Tests - RSC with streamed Promise data', () => { | |||||||||||||||
| await expect(page.getByTestId('analytics-display')).toBeVisible({ | ||||||||||||||||
| timeout: DEFERRED_DATA_TIMEOUT, | ||||||||||||||||
| }) | ||||||||||||||||
| await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated') | ||||||||||||||||
| await waitForHydration(page) | ||||||||||||||||
|
|
||||||||||||||||
| // Initially no metric selected | ||||||||||||||||
| await expect(page.getByTestId('selected-metric')).not.toBeVisible() | ||||||||||||||||
|
|
@@ -126,7 +127,7 @@ test.describe('RSC Deferred Tests - RSC with streamed Promise data', () => { | |||||||||||||||
| await expect(page.getByTestId('analytics-display')).toBeVisible({ | ||||||||||||||||
| timeout: DEFERRED_DATA_TIMEOUT, | ||||||||||||||||
| }) | ||||||||||||||||
| await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated') | ||||||||||||||||
| await waitForHydration(page) | ||||||||||||||||
|
|
||||||||||||||||
| // Get initial values | ||||||||||||||||
| const initialTimestamp = await page | ||||||||||||||||
|
|
@@ -158,7 +159,7 @@ test.describe('RSC Deferred Tests - RSC with streamed Promise data', () => { | |||||||||||||||
| // Start at home | ||||||||||||||||
| await page.goto('/') | ||||||||||||||||
| await page.waitForURL('/') | ||||||||||||||||
| await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated') | ||||||||||||||||
| await waitForHydration(page) | ||||||||||||||||
|
|
||||||||||||||||
| // Navigate to deferred page via nav bar | ||||||||||||||||
| await page.getByTestId('nav-deferred').click() | ||||||||||||||||
|
|
||||||||||||||||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: TanStack/router
Length of output: 41
🏁 Script executed:
Repository: TanStack/router
Length of output: 315
🏁 Script executed:
Repository: TanStack/router
Length of output: 916
🏁 Script executed:
Repository: TanStack/router
Length of output: 448
🏁 Script executed:
Repository: TanStack/router
Length of output: 818
🏁 Script executed:
# Read e2e ESLint config cat ./e2e/eslint-plugin-start/eslint.config.jsRepository: TanStack/router
Length of output: 645
🏁 Script executed:
Repository: TanStack/router
Length of output: 342
🏁 Script executed:
Repository: TanStack/router
Length of output: 41
🏁 Script executed:
Repository: TanStack/router
Length of output: 3853
🏁 Script executed:
# Check the specific e2e/react-start/rsc/eslint.config.js config cat ./e2e/react-start/rsc/eslint.config.jsRepository: TanStack/router
Length of output: 617
🏁 Script executed:
# Search for any ESLint comments or disable directives in the hydration.ts file cat -n e2e/react-start/rsc/tests/hydration.tsRepository: TanStack/router
Length of output: 315
🏁 Script executed:
Repository: TanStack/router
Length of output: 41
🏁 Script executed:
Repository: TanStack/router
Length of output: 636
🏁 Script executed:
Repository: TanStack/router
Length of output: 553
🏁 Script executed:
Repository: TanStack/router
Length of output: 1668
🏁 Script executed:
Repository: TanStack/router
Length of output: 905
🏁 Script executed:
Repository: TanStack/router
Length of output: 41
🏁 Script executed:
Repository: TanStack/router
Length of output: 1317
🏁 Script executed:
Repository: TanStack/router
Length of output: 141
🏁 Script executed:
# Verify the root eslint.config.js doesn't have any overrides for test files cat ./eslint.config.jsRepository: TanStack/router
Length of output: 818
🏁 Script executed:
Repository: TanStack/router
Length of output: 738
🏁 Script executed:
Repository: TanStack/router
Length of output: 2001
🏁 Script executed:
Repository: TanStack/router
Length of output: 1802
🏁 Script executed:
Repository: TanStack/router
Length of output: 41
🏁 Script executed:
# Check what import rules are defined in `@tanstack/eslint-config` cat ./node_modules/.pnpm/@tanstack+eslint-config@0.4.0_@typescript-eslint+utils@8.57.1_eslint@9.22.0_jiti@2.6.1__71a7465028deca506823eb713e9f533e/node_modules/@tanstack/eslint-config/dist/import.jsRepository: TanStack/router
Length of output: 592
🏁 Script executed:
Repository: TanStack/router
Length of output: 41
Separate the type import to top level to satisfy lint rules.
The file uses inline
type Pagespecifier which violates the configuredimport/consistent-type-specifier-stylerule (set to"error"with"prefer-top-level"style in@tanstack/eslint-config).♻️ Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 ESLint
[error] 1-1: Member 'Page' of the import declaration should be sorted alphabetically.
(sort-imports)
[error] 1-1: Prefer using a top-level type-only import instead of inline type specifiers.
(import/consistent-type-specifier-style)
🤖 Prompt for AI Agents