// Runner config: use iPhone Duo for iOS and actionTimeout: 180_000.
import { expect } from "e2e";
import { IOS, test } from "./t3-mobile.ts";

test("A bare settings link returns from About to the Settings list", IOS, async ({ t3, app, screen, device }) => {
  const project = await t3.project("Link demo");
  await t3.thread({ project, title: "Replay thread", messages: ["Hello"] });
  await device.fold("closed");
  await t3.open();
  const open = async (path: string) => {
    await device.openLink(`t3code-dev://${path}`, { app: "com.t3tools.t3code.dev" });
    await device.alert("accept").catch(() => {});
  };
  await open("settings/about");
  await screen.getByText("About", { exact: true }).first().waitFor();
  await app.screenshot("about-before-link");
  await open("settings");
  await app.screenshot("bare-settings-link");
  await expect(screen.getByText("Appearance", { exact: true })).toBeVisible();
});
