Skip to content
Source
Sign inSign up
TanStack/router

fix(solid-start): navigation transitions #5792

Mergedbirkskyum(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/5792/headmerged by birkskyum(GitHub profile, opens in a new tab)

Showing 6 changed files with 98 additions and 1 deletion (loading 3).

x
0 of 6 viewed, 6 left
95 additions and 0 deletionse2e/solid-start/basic/tests/transition.spec.tsAdded
View file
@@ -0,0 +1,95 @@
+import { expect, test } from '@playwright/test'
+​
+test('transitions/count/create-resource should keep old values visible during navigation', async ({
+ page,
+}) => {
+ await page.goto('/transition/count/create-resource')
+​
+ await expect(page.getByTestId('n-value')).toContainText('n: 1')
+ await expect(page.getByTestId('double-value')).toContainText('double: 2')
+​
+ const bodyTexts: Array<string> = []
+​
+ const pollInterval = setInterval(async () => {
+ const text = await page
+ .locator('body')
+ .textContent()
+ .catch(() => '')
+ if (text) bodyTexts.push(text)
+ }, 50)
+​
+ // 1 click
+​
+ page.getByTestId('increase-button').click()
Thread on line 23

⚠️ Potential issue | 🟠 Major

Await Playwright click actions to prevent race conditions.

The click operation is missing await, which can cause race conditions where the test proceeds before the click is fully processed. This is particularly problematic when testing transition behavior with precise timing requirements.

Apply this diff:

-  page.getByTestId('increase-button').click()
+  await page.getByTestId('increase-button').click()

Also applies to: 45-46, 66-68

🤖 Prompt for AI Agents
In e2e/solid-start/basic/tests/transition.spec.ts around lines 23 (and also at
45-46 and 66-68), the Playwright click calls are not awaited which can cause
race conditions; update each occurrence to await the click promise (i.e., prefix
each page.getByTestId(...).click() with await) so the test waits for the click
to complete before proceeding, keeping the existing selectors and test flow
intact.