Skip to content

Commit e870fd9

Browse files
committed
test(router): make the remount test more clear if there's extra mount initially
1 parent f9bf3a5 commit e870fd9

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

e2e/react-router/basic-file-based/tests/app.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,10 @@ test('Should not remount deps when remountDeps does not change ', async ({
296296
await expect(page.getByTestId('component-mounts')).toContainText(
297297
'Page component mounts: 1',
298298
)
299+
await page.getByRole('button', { name: 'Regenerate search param' }).click()
300+
await expect(page.getByTestId('component-mounts')).toContainText(
301+
'Page component mounts: 1',
302+
)
299303
})
300304

301305
test('Should remount deps when remountDeps does change ', async ({ page }) => {
@@ -307,4 +311,8 @@ test('Should remount deps when remountDeps does change ', async ({ page }) => {
307311
await expect(page.getByTestId('component-mounts')).toContainText(
308312
'Page component mounts: 2',
309313
)
314+
await page.getByRole('button', { name: 'Regenerate search param' }).click()
315+
await expect(page.getByTestId('component-mounts')).toContainText(
316+
'Page component mounts: 3',
317+
)
310318
})

e2e/solid-router/basic-file-based/tests/app.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@ test.skip('Should not remount deps when remountDeps does not change ', async ({
284284
await expect(page.getByTestId('component-mounts')).toContainText(
285285
'Page component mounts: 1',
286286
)
287+
await page.getByRole('button', { name: 'Regenerate search param' }).click()
288+
await expect(page.getByTestId('component-mounts')).toContainText(
289+
'Page component mounts: 1',
290+
)
287291
})
288292

289293
test('Should remount deps when remountDeps does change ', async ({ page }) => {
@@ -295,4 +299,8 @@ test('Should remount deps when remountDeps does change ', async ({ page }) => {
295299
await expect(page.getByTestId('component-mounts')).toContainText(
296300
'Page component mounts: 2',
297301
)
302+
await page.getByRole('button', { name: 'Regenerate search param' }).click()
303+
await expect(page.getByTestId('component-mounts')).toContainText(
304+
'Page component mounts: 3',
305+
)
298306
})

0 commit comments

Comments
 (0)