Skip to content

Commit 00b41ad

Browse files
committed
test(start): await restored RSC route updates between HMR tests
1 parent 877acaf commit 00b41ad

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

‎e2e/react-start/rsc-hmr/tests/rsc-hmr.spec.ts‎

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,34 @@ test.beforeEach(async () => {
9696
await routeFileEditor.restoreFiles()
9797
})
9898

99-
test.afterEach(async () => {
99+
test.afterEach(async ({ page }) => {
100100
await routeFileEditor.capturePromise
101-
await routeFileEditor.restoreFiles()
101+
const restoredKeys = await routeFileEditor.restoreFiles()
102+
for (const key of restoredKeys) {
103+
switch (key) {
104+
case 'coLocated':
105+
await hmrExpect(page.getByTestId('co-located-marker')).toHaveText(
106+
MARKERS.coLocated,
107+
)
108+
break
109+
case 'cssModuleRoute':
110+
await hmrExpect(page.getByTestId('css-module-marker')).toHaveText(
111+
MARKERS.cssModule,
112+
)
113+
break
114+
case 'cssModuleStyles':
115+
await hmrExpect(page.getByTestId('css-module-marker')).toHaveCSS(
116+
'color',
117+
CSS_BASELINE_COLOR,
118+
)
119+
break
120+
case 'separateFile':
121+
await hmrExpect(page.getByTestId('separate-file-marker')).toHaveText(
122+
MARKERS.separateFile,
123+
)
124+
break
125+
}
126+
}
102127
})
103128

104129
test.describe('RSC route component HMR with a co-located server function', () => {

0 commit comments

Comments
 (0)