From 79628873879728082ad6ed49949c705dcc51d5d5 Mon Sep 17 00:00:00 2001 From: Siddharth Kumar Sah Date: Mon, 6 Apr 2026 19:35:25 +0800 Subject: [PATCH] test: add e2e tests for edit-metadata tool --- tests/e2e/tools-all.spec.ts | 1 + tests/e2e/tools-process.spec.ts | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/tests/e2e/tools-all.spec.ts b/tests/e2e/tools-all.spec.ts index e7af3a26..5f616f34 100644 --- a/tests/e2e/tools-all.spec.ts +++ b/tests/e2e/tools-all.spec.ts @@ -12,6 +12,7 @@ const TOOLS_WITH_DROPZONE = [ { id: "convert", name: "Convert" }, { id: "compress", name: "Compress" }, { id: "strip-metadata", name: "Strip Metadata" }, + { id: "edit-metadata", name: "Edit Metadata" }, { id: "bulk-rename", name: "Bulk Rename" }, { id: "image-to-pdf", name: "Image to PDF" }, { id: "favicon", name: "Favicon" }, diff --git a/tests/e2e/tools-process.spec.ts b/tests/e2e/tools-process.spec.ts index 64ed0bcc..6dac1a98 100644 --- a/tests/e2e/tools-process.spec.ts +++ b/tests/e2e/tools-process.spec.ts @@ -89,6 +89,23 @@ test.describe("Tool processing (core tools)", () => { }); }); + test("edit-metadata processes image", async ({ loggedInPage: page }) => { + await page.goto("/edit-metadata"); + await uploadTestImage(page); + + // Wait for inspect to complete and form to populate + await page.waitForSelector('[id="em-artist"]', { timeout: 10_000 }); + + // Edit the artist field + await page.fill('[id="em-artist"]', "E2E Test Artist"); + + await page.getByRole("button", { name: /apply metadata/i }).click(); + await waitForProcessing(page); + await expect(page.getByRole("link", { name: /download/i }).first()).toBeVisible({ + timeout: 15_000, + }); + }); + test("brightness-contrast processes image", async ({ loggedInPage: page }) => { await page.goto("/brightness-contrast"); await uploadTestImage(page);