diff --git a/frontend/e2e/ReviewTemplate.spec.ts b/frontend/e2e/ReviewTemplate.spec.ts index edf8aa9d..c8360403 100644 --- a/frontend/e2e/ReviewTemplate.spec.ts +++ b/frontend/e2e/ReviewTemplate.spec.ts @@ -15,17 +15,6 @@ test.describe("ReviewTemplate Page", () => { await expect(page).toHaveURL("/extract/upload"); }); - // Test the Done button functionality - test("Done button navigates correctly", async ({ page }) => { - const submitButton = page.getByRole("button", { name: "Done" }); - await expect(submitButton).toBeDisabled(); - const errorRows = await page.locator("tr *[data-testid='edit-fix-error']"); - for (const row of await errorRows.elementHandles()) { - await row.click(); - await page.keyboard.press("Enter"); - } - }); - // Test the extracted data section test("Displays extracted data with overall confidence score", async ({ page, @@ -120,10 +109,11 @@ test.describe("ReviewTemplate Page", () => { await page.keyboard.press("Enter"); } + const finalSubmitButton = page.getByRole("button", { name: "Download CSV" }); await expect(submitButton).toBeEnabled(); await submitButton.click(); - await submitButton.click(); + await finalSubmitButton.click(); await expect(page).toHaveURL("/"); }); }); diff --git a/frontend/src/components/ExtractDataHeader.tsx b/frontend/src/components/ExtractDataHeader.tsx index 8f9c2147..db453244 100644 --- a/frontend/src/components/ExtractDataHeader.tsx +++ b/frontend/src/components/ExtractDataHeader.tsx @@ -5,9 +5,9 @@ import "./ExtractDataHeader.scss"; interface ExtractDataHeaderProps { onBack: () => void; - onSubmit: () => void; onExit: () => void; isUploadComplete: boolean; + onSubmit?: () => void; hasSubmit?: boolean; } diff --git a/frontend/src/components/Header.tsx b/frontend/src/components/Header.tsx index d99dbf77..7c4ea1bf 100644 --- a/frontend/src/components/Header.tsx +++ b/frontend/src/components/Header.tsx @@ -7,7 +7,7 @@ interface UploadHeaderProps { title: string; isUpload?: boolean; onBack: () => void; - onSubmit: () => void; + onSubmit?: () => void; } export const UploadHeader = ({ @@ -41,9 +41,13 @@ export const UploadHeader = ({ > Back - + { + onSubmit && ( + + ) + } diff --git a/frontend/src/components/ReviewBulk.tsx b/frontend/src/components/ReviewBulk.tsx index 2125664b..813db2af 100644 --- a/frontend/src/components/ReviewBulk.tsx +++ b/frontend/src/components/ReviewBulk.tsx @@ -76,6 +76,11 @@ const ReviewBulk = ({ ); }; + const handleCSVDownload = () => { + onDownload(); + navigate("/"); + } + return (