Skip to content

Commit

Permalink
test: shared component hmr
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Apr 29, 2024
1 parent 5509f0e commit d5771de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/react-server/e2e/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ test("shared hmr @dev", async ({ page }) => {
usePageErrorChecker(page);
await page.goto("/");
await waitForHydration(page);

await using editor = await createEditor("src/routes/_shared.tsx");
await using _ = await createReloadChecker(page);

await page.getByText("Shared Component (server)").click();
await page.getByText("Shared Component (client)").click();
await editor.edit((s) =>
s.replace("Shared Component", "Shared [EDIT] Component"),
);
await page.getByText("Shared [EDIT] Component (server)").click();
await page.getByText("Shared [EDIT] Component (client)").click();
});

test("server-action @js", async ({ page }) => {
Expand Down
1 change: 1 addition & 0 deletions examples/react-server/e2e/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export async function createReloadChecker(page: Page) {
}

async function check() {
// TODO: wait for network idle?
await expect(page.locator(`meta[name="x-reload-check"]`)).toBeAttached({
timeout: 1,
});
Expand Down

0 comments on commit d5771de

Please sign in to comment.