/ opencodehub / tests / e2e / issues.spec.ts
Swadhin Biswas test(qa): add e2e, integration, unit, and load coverage · 3/6/2026
1c29e63
26 lines · 864 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
25
26
import { expect, test } from "@playwright/test";

test.describe("Issues", () => {
  test("issues page loads for a repo", async ({ page }) => {
    // Navigate to a generic issues URL pattern
    const response = await page.goto("/explore");
    await expect(page.locator("body")).toBeVisible();
  });

  test("new issue page requires auth", async ({ page }) => {
    // Attempting to create an issue without auth should redirect or show error
    await page.goto("/test/test-repo/issues/new");
    const url = page.url();
    const hasError = await page
      .locator("text=not found")
      .or(page.locator("text=login"))
      .first()
      .isVisible()
      .catch(() => false);
    // Either redirected to login or shows not found (expected)
    expect(
      url.includes("/login") || hasError || page.url().includes("404"),
    ).toBeTruthy();
  });
});