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

test.describe("Fork Repository", () => {
  test("fork requires authentication", async ({ page }) => {
    await page.goto("/test/test-repo");
    // Fork button should require auth
    const forkBtn = page.locator("button:has-text('Fork'), a:has-text('Fork')");
    if (await forkBtn.isVisible().catch(() => false)) {
      await forkBtn.click();
      // Should redirect to login
      await page.waitForTimeout(1000);
      const url = page.url();
      expect(url.includes("/login") || url.includes("/fork")).toBeTruthy();
    }
  });
});