/ opencodehub / tests / e2e / notifications.spec.ts
Swadhin Biswas test(qa): add e2e, integration, unit, and load coverage · 3/6/2026
1c29e63
24 lines · 671 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { expect, test } from "@playwright/test";

test.describe("Notifications", () => {
  test("notifications API requires auth", async ({ request }) => {
    const res = await request.get("/api/notifications");
    expect(res.status()).toBe(401);
  });

  test("notifications page requires auth", async ({ page }) => {
    await page.goto("/notifications");
    const url = page.url();
    expect(
      url.includes("/login") ||
        (await page
          .locator("text=login")
          .or(page.locator("text=Sign in"))
          .first()
          .isVisible()
          .catch(() => false)) ||
        page.url().includes("404"),
    ).toBeTruthy();
  });
});