mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
feat: pipeline templates, analytics opt-out, 83 conversion presets, positioning + e2e modernization
Lands five integrated branches: pipeline templates (#355), analytics opt-out (#354), 83 conversion presets bringing the catalog to 240 tools (#356), self-hosted positioning (#353), and e2e modernization (#351). Integration fixes: aligned stale web analytics tests with the opt-out/allow-list model, closed 3 CodeQL incomplete-sanitization alerts in the i18n generator, resolved settings/index/docs/format-matrix conflicts, and corrected tool counts to 240.
This commit is contained in:
@@ -2,7 +2,7 @@ import path from "node:path";
|
||||
import { expect, isAiSidecarRunning, test } from "./helpers";
|
||||
|
||||
function fixturePath(name: string): string {
|
||||
return path.join(process.cwd(), "tests", "fixtures", name);
|
||||
return path.join(process.cwd(), "tests", "fixtures", "image", "valid", name);
|
||||
}
|
||||
|
||||
async function uploadFile(page: import("@playwright/test").Page, filePath: string) {
|
||||
@@ -19,14 +19,21 @@ test.describe("AI Canvas Expand", () => {
|
||||
await page.goto("/image/ai-canvas-expand");
|
||||
|
||||
await expect(page.getByText("Tool not found")).not.toBeVisible();
|
||||
await expect(page.getByText("AI Canvas Expand")).toBeVisible();
|
||||
// Heading appears in both the breadcrumb and the page; .first() avoids a
|
||||
// strict-mode multiple-match error.
|
||||
await expect(page.getByText("AI Canvas Expand").first()).toBeVisible();
|
||||
|
||||
// Settings (aspect-ratio + per-side inputs) only mount after a file loads.
|
||||
await uploadFile(page, fixturePath("test-200x150.png"));
|
||||
await expect(page.getByText("Extend to aspect ratio")).toBeVisible();
|
||||
await expect(page.getByText("Extend by (pixels)")).toBeVisible();
|
||||
});
|
||||
|
||||
test("standalone submit disabled without file", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/image/ai-canvas-expand");
|
||||
await expect(page.getByTestId("ai-canvas-expand-submit")).toBeDisabled();
|
||||
// The settings panel (and its submit button) mount only after a file is
|
||||
// uploaded; before upload the page shows just the dropzone.
|
||||
await expect(page.getByTestId("ai-canvas-expand-submit")).toHaveCount(0);
|
||||
});
|
||||
|
||||
test("standalone submit disabled when all extensions are zero", async ({
|
||||
@@ -77,6 +84,7 @@ test.describe("AI Canvas Expand", () => {
|
||||
|
||||
test("tier buttons render with Balanced selected by default", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/image/ai-canvas-expand");
|
||||
await uploadFile(page, fixturePath("test-200x150.png"));
|
||||
|
||||
await expect(page.getByTestId("tier-fast")).toBeVisible();
|
||||
await expect(page.getByTestId("tier-balanced")).toBeVisible();
|
||||
@@ -88,6 +96,7 @@ test.describe("AI Canvas Expand", () => {
|
||||
|
||||
test("clicking tier button changes selection", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/image/ai-canvas-expand");
|
||||
await uploadFile(page, fixturePath("test-200x150.png"));
|
||||
|
||||
await page.getByTestId("tier-fast").click();
|
||||
await expect(page.getByTestId("tier-fast")).toHaveClass(/bg-primary/);
|
||||
@@ -98,6 +107,7 @@ test.describe("AI Canvas Expand", () => {
|
||||
|
||||
test("tier description updates on selection", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/image/ai-canvas-expand");
|
||||
await uploadFile(page, fixturePath("test-200x150.png"));
|
||||
|
||||
await expect(page.getByText("Good quality, moderate speed")).toBeVisible();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user