Files
SnapOtter/tests/e2e/url-import.spec.ts
T
SnapOtterandGitHub 0f98f60c33 test(e2e): modernize stale routes for 2.0 section URLs (#347)
The e2e specs predate the 2.0 section-route migration and navigated to
single-segment tool URLs (/resize) that now 404 (App.tsx only mounts
/:section/:toolId). This broke the whole e2e suite (Cross-Browser, Device
Matrix, E2E Full, Visual) - part of the known stale-spec backlog.

- Sweep 929 goto("/<tool>") -> goto("/<section>/<tool>") across 45 spec
  files, using the authoritative TOOLS + toolSection() mapping. Two-segment
  routes, top-level routes (/automate, /editor, ...), and intentional 404
  tests (/nonexistent-*) are untouched.
- Implement the legacy redirects the specs already assert: the 1.x color
  tools (brightness-contrast, saturation, color-channels, color-effects)
  redirect to /image/adjust-colors (App.tsx). Good for old bookmarks too.
- Remove the analytics-consent page tests (gui-navigation + gui-visual);
  #336 deleted that page.

Mechanical + biome-clean + web typecheck passes. Browser-specific behavior
can only be confirmed by the nightly e2e jobs.
2026-06-24 20:19:37 +08:00

26 lines
853 B
TypeScript

import { expect, test } from "./helpers";
test.describe("URL Image Import", () => {
test("inline URL input is visible on tool page", async ({ loggedInPage: page }) => {
await page.goto("/image/resize");
await expect(page.getByPlaceholder("Paste image URL...")).toBeVisible();
});
test("bulk import modal opens and closes", async ({ loggedInPage: page }) => {
await page.goto("/image/resize");
// Open the bulk import modal
await page.getByText("Import multiple URLs...").click();
// Assert the modal title is visible
await expect(page.getByText("Import from URLs")).toBeVisible();
// Close the modal via Cancel
await page.getByRole("button", { name: "Cancel" }).click();
// Assert the modal title is no longer visible
await expect(page.getByText("Import from URLs")).not.toBeVisible();
});
});