From 47ea1af36937ae3fe337d112dabf57abb08e8800 Mon Sep 17 00:00:00 2001 From: developomp Date: Wed, 2 Aug 2023 00:57:58 +0900 Subject: [PATCH] test: add 404 status code test --- apps/blog/e2e/notfound.spec.ts | 6 ++++++ apps/main/e2e/notfound.spec.ts | 6 ++++++ apps/portfolio/e2e/notfound.spec.ts | 6 ++++++ 3 files changed, 18 insertions(+) create mode 100644 apps/blog/e2e/notfound.spec.ts create mode 100644 apps/main/e2e/notfound.spec.ts create mode 100644 apps/portfolio/e2e/notfound.spec.ts diff --git a/apps/blog/e2e/notfound.spec.ts b/apps/blog/e2e/notfound.spec.ts new file mode 100644 index 0000000..df2645b --- /dev/null +++ b/apps/blog/e2e/notfound.spec.ts @@ -0,0 +1,6 @@ +import { expect, test } from "@playwright/test" + +test("Should return 404 for invalid routes", async ({ page }) => { + const response = await page.goto("/path/that/does/not/exist") + expect(response?.status()).toEqual(404) +}) diff --git a/apps/main/e2e/notfound.spec.ts b/apps/main/e2e/notfound.spec.ts new file mode 100644 index 0000000..df2645b --- /dev/null +++ b/apps/main/e2e/notfound.spec.ts @@ -0,0 +1,6 @@ +import { expect, test } from "@playwright/test" + +test("Should return 404 for invalid routes", async ({ page }) => { + const response = await page.goto("/path/that/does/not/exist") + expect(response?.status()).toEqual(404) +}) diff --git a/apps/portfolio/e2e/notfound.spec.ts b/apps/portfolio/e2e/notfound.spec.ts new file mode 100644 index 0000000..df2645b --- /dev/null +++ b/apps/portfolio/e2e/notfound.spec.ts @@ -0,0 +1,6 @@ +import { expect, test } from "@playwright/test" + +test("Should return 404 for invalid routes", async ({ page }) => { + const response = await page.goto("/path/that/does/not/exist") + expect(response?.status()).toEqual(404) +})