/ opencodehub / tests / e2e / org-management.spec.ts
Swadhin Biswas test(qa): add e2e, integration, unit, and load coverage · 3/6/2026
1c29e63
24 lines · 693 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("Organization Management", () => {
  test("org creation requires auth", async ({ page }) => {
    await page.goto("/orgs/new");
    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();
  });

  test("org members API requires auth", async ({ request }) => {
    const res = await request.get("/api/orgs/test-org/members");
    expect([401, 403, 404]).toContain(res.status());
  });
});