import { test, expect } from "@playwright/test";
import { TOKENS } from "./tokens";
import { testRouteForToken } from "./route.helper";
import { urlParams } from "../variables.playwright";

test.describe("Route – auth", () => {
  test.beforeEach(async ({ page }) => {
    await page.goto(urlParams, { waitUntil: "networkidle" });
    await expect(page.getByTestId("open-wallet-button")).toBeVisible({
      timeout: 10_000,
    });
  });

  for (const { chainId, tokenId } of TOKENS) {
    test(`${tokenId}@${chainId}`, async ({ page }) => {
      // Page already has cookies and localStorage from globalSetup
      await testRouteForToken(page, chainId, tokenId);
    });
  }
});
