Skip to content

Commit d03e000

Browse files
committed
test(rsc): add more basic tests to starter
1 parent 87319bf commit d03e000

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

packages/plugin-rsc/e2e/starter.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,25 @@ function defineTest(f: Fixture, variant?: 'no-ssr') {
110110
await page.getByRole('button', { name: 'Client Counter: 0' }).click()
111111
})
112112

113+
test.describe(() => {
114+
test.skip(f.mode === 'build')
115+
116+
test('server hmr', async ({ page }) => {
117+
await page.goto(f.url())
118+
await waitForHydration(page)
119+
await using _ = await expectNoReload(page)
120+
const editor = f.createEditor('src/root.tsx')
121+
editor.edit((s) => s.replace('Server Counter', 'Server [edit] Counter'))
122+
await expect(
123+
page.getByRole('button', { name: 'Server [edit] Counter: 0' }),
124+
).toBeVisible()
125+
editor.reset()
126+
await expect(
127+
page.getByRole('button', { name: 'Server Counter: 0' }),
128+
).toBeVisible()
129+
})
130+
})
131+
113132
test('image assets', async ({ page }) => {
114133
await page.goto(f.url())
115134
await waitForHydration(page)

0 commit comments

Comments
 (0)