From 4e5c987676460c03a9de75a30b55b454a413e717 Mon Sep 17 00:00:00 2001 From: Jessica Eldredge Date: Wed, 18 Dec 2024 11:22:18 -0500 Subject: [PATCH] CMDCT-3860: Playwright test for resubmit WP (#827) --- .../components/pages/Dashboard/DashboardTable.tsx | 2 +- tests/e2e/wp/create.spec.ts | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/services/ui-src/src/components/pages/Dashboard/DashboardTable.tsx b/services/ui-src/src/components/pages/Dashboard/DashboardTable.tsx index ec6d36a88..33db83a01 100644 --- a/services/ui-src/src/components/pages/Dashboard/DashboardTable.tsx +++ b/services/ui-src/src/components/pages/Dashboard/DashboardTable.tsx @@ -68,7 +68,7 @@ export const DashboardTable = ({ {/* Admin: Submission count */} {isAdmin && ( - + {!report.submissionCount || report.submissionCount === 0 ? 1 : report.submissionCount} diff --git a/tests/e2e/wp/create.spec.ts b/tests/e2e/wp/create.spec.ts index e278aa669..6e4cc213b 100644 --- a/tests/e2e/wp/create.spec.ts +++ b/tests/e2e/wp/create.spec.ts @@ -210,4 +210,18 @@ test.describe("Creating a new Work Plan", () => { await modal.getByRole("button", { name: "Return to dashboard" }).click(); await expect(unlockButton).toBeDisabled(); }); + + test("State user can resubmit a work plan", async () => { + await wpDashboard.goto(); + await wpDashboard.firstReport.getByRole("button", { name: "Edit" }).click(); + await wpGeneralInformation.isReady(); + await wpReviewAndSubmit.goto(); + await expect(wpReviewAndSubmit.submitButton).toBeEnabled(); + await wpReviewAndSubmit.submitButton.click(); + await wpReviewAndSubmit.confirmSubmit(); + await adminWpDashboard.goto(); + await expect( + adminWpDashboard.page.getByTestId("dashboard-submission-count") + ).toContainText("2"); + }); });