From 47d05490ad3b80dea3fe48acf417047a9aa05031 Mon Sep 17 00:00:00 2001 From: Brianna Cerkiewicz Date: Mon, 11 Sep 2023 10:58:56 -0700 Subject: [PATCH] chore: update jest tests --- ...rojectFundingAgreementFormSummary.test.tsx | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/app/tests/unit/components/Form/ProjectFundingAgreementFormSummary.test.tsx b/app/tests/unit/components/Form/ProjectFundingAgreementFormSummary.test.tsx index e183263ef0..17f09244eb 100644 --- a/app/tests/unit/components/Form/ProjectFundingAgreementFormSummary.test.tsx +++ b/app/tests/unit/components/Form/ProjectFundingAgreementFormSummary.test.tsx @@ -578,32 +578,15 @@ describe("The Project Funding Agreement Form Summary", () => { return result; }, }); - componentTestingHelper.renderComponent(); + componentTestingHelper.renderComponent(undefined, { + viewOnly: true, + }); expect( screen.getByText(/budgets, expenses & payments not added/i) ).toBeInTheDocument(); }); - it("Displays relevant message when funding agreement not updated", () => { - componentTestingHelper.loadQuery({ - ...mockQueryPayloadEP, - ProjectRevision() { - const result: Partial = - { - isFirstRevision: false, - summaryProjectFundingAgreementFormChanges: { - edges: [], - }, - }; - return result; - }, - }); - componentTestingHelper.renderComponent(); - expect( - screen.getByText(/budgets, expenses & payments not updated/i) - ).toBeInTheDocument(); - }); it("Displays relevant message when funding agreement removed", () => { componentTestingHelper.loadQuery({ ...mockQueryPayloadEP, @@ -648,10 +631,13 @@ describe("The Project Funding Agreement Form Summary", () => { return result; }, }); - componentTestingHelper.renderComponent(); + componentTestingHelper.renderComponent(undefined, { + isOnAmendmentsAndOtherRevisionsPage: true, + viewOnly: false, + }); expect( - screen.queryAllByText(/budgets, expenses & payments/i)[1] + screen.queryAllByText(/budgets, expenses & payments/i)[0] ).toHaveClass("diffOld"); });