Skip to content

Commit

Permalink
test: add e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Jun 23, 2024
1 parent 88b46e2 commit 3a2684c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions vue-server/e2e/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ testNoJs("basic @nojs", async ({ page }) => {
await page.getByText("Count: 0").click();
});

test("ssr", async ({ request }) => {
const res = await request.get("/");
const resText = await res.text();
expect(resText).toMatch(
/^<!DOCTYPE html>\s*<html>\s*<head>.*<\/head>\s*<body>.*<\/body>\s*<\/html>\s*$/s,
);
});

test("navigation @js", async ({ page }) => {
await page.goto("/");
await waitForHydration(page);
Expand Down Expand Up @@ -84,7 +92,6 @@ async function testFormNavigation(page: Page, options: { js: boolean }) {
test("hmr server @dev", async ({ page }) => {
await page.goto("/");
await waitForHydration(page);
await page.pause();

// check client state is preserved
await page.getByRole("button", { name: "client sfc: 0" }).click();
Expand All @@ -111,7 +118,6 @@ test("hmr server @dev", async ({ page }) => {
test("hmr sfc @dev", async ({ page }) => {
await page.goto("/sfc");
await waitForHydration(page);
await page.pause();

await page.getByRole("button", { name: "client counter 0" }).first().click();
await page.getByRole("button", { name: "client counter 1" }).click();
Expand Down

0 comments on commit 3a2684c

Please sign in to comment.