fix(pdf): restore downloads on PDF conversion preset pages (#629)

Adds downloadUrl/originalSize/processedSize to the pdf-to-image route's synchronous response so PDF conversion presets (pdf-to-png, pdf-to-jpg, pdf-to-tiff) satisfy the standard tool-result contract and show their download action again.

Fixes #623

Co-authored-by: EuanTop <euan@mail.bnu.edu.cn>
This commit is contained in:
Euan
2026-07-24 18:53:19 +08:00
committed by GitHub
parent 301e6eb01a
commit e0a7aecde8
4 changed files with 77 additions and 1 deletions
+17
View File
@@ -72,3 +72,20 @@ test.describe("PDF to Image tool", () => {
await expect(page.locator("text=3 of 3 pages selected")).toBeVisible();
});
});
test.describe("PDF conversion preset pages", () => {
for (const toolId of ["pdf-to-png", "pdf-to-jpg"]) {
test(`${toolId} shows the ZIP download after synchronous conversion`, async ({
loggedInPage: page,
}) => {
await page.goto(`/pdf/${toolId}`);
await uploadPdf(page);
await page.getByTestId("preset-submit").click();
const download = page.getByTestId("preset-download");
await expect(download).toBeVisible({ timeout: 15_000 });
await expect(download).toHaveAttribute("href", /\/api\/v1\/download\/[^/]+\/pdf-pages\.zip$/);
});
}
});