import { expect } from "e2e";
import { test, WEB } from "./t3.ts";

test("HTTP-only Forgejo login is not labelled unauthenticated", WEB, async ({ t3, app, screen, browser }) => {
  // The server inherits an isolated XDG_DATA_HOME containing an official fj v0.7.0
  // login for the real HTTP-only Forgejo fixture. No project or remote is in scope.
  await t3.open();
  await browser.waitForURL(/^http:\/\/127\.0\.0\.1:\d+\/$/);
  await app.open("/settings/source-control");
  await screen.getByText("fj v0.7.0", { exact: true }).tap();
  await app.screenshot("forgejo-http-login");
  await expect(screen.getByText("Forgejo / Gitea is not authenticated on this server.", { exact: false })).not.toBeVisible();
});
