From 4670f07f8b4b51fbe3dd201578f29c17591ff27e Mon Sep 17 00:00:00 2001 From: Gurjeet Matharu Date: Tue, 7 Feb 2023 16:59:55 -0500 Subject: [PATCH] fix: adding 2 decimal places to provence share percerntage --- app/data/jsonSchemaForm/fundingAgreementSchema.ts | 1 + .../unit/components/Form/ProjectFundingAgreementForm.test.tsx | 2 +- .../Form/ProjectFundingAgreementFormSummary.test.tsx | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/data/jsonSchemaForm/fundingAgreementSchema.ts b/app/data/jsonSchemaForm/fundingAgreementSchema.ts index ae84400206..98e8298aa4 100644 --- a/app/data/jsonSchemaForm/fundingAgreementSchema.ts +++ b/app/data/jsonSchemaForm/fundingAgreementSchema.ts @@ -80,6 +80,7 @@ export const fundingAgreementUiSchema = { provinceSharePercentage: { "ui:widget": "NumberWidget", isPercentage: true, + numberOfDecimalPlaces: 2, }, holdbackPercentage: { "ui:widget": "NumberWidget", diff --git a/app/tests/unit/components/Form/ProjectFundingAgreementForm.test.tsx b/app/tests/unit/components/Form/ProjectFundingAgreementForm.test.tsx index f557c087cb..071773f419 100644 --- a/app/tests/unit/components/Form/ProjectFundingAgreementForm.test.tsx +++ b/app/tests/unit/components/Form/ProjectFundingAgreementForm.test.tsx @@ -153,7 +153,7 @@ describe("The ProjectFundingAgreementForm", () => { expect( screen.getByLabelText(/Province's Share Percentage/i) .value - ).toBe("50 %"); + ).toBe("50.00 %"); expect( screen.getByLabelText( /Performance Milestone Holdback Percentage/i diff --git a/app/tests/unit/components/Form/ProjectFundingAgreementFormSummary.test.tsx b/app/tests/unit/components/Form/ProjectFundingAgreementFormSummary.test.tsx index 7468820c81..f8c6843313 100644 --- a/app/tests/unit/components/Form/ProjectFundingAgreementFormSummary.test.tsx +++ b/app/tests/unit/components/Form/ProjectFundingAgreementFormSummary.test.tsx @@ -144,8 +144,8 @@ describe("The Project Funding Agreement Form Summary", () => { componentTestingHelper.loadQuery(); componentTestingHelper.renderComponent(); - expect(screen.getByText("50 %")).toBeInTheDocument(); - expect(screen.getByText("60 %")).toBeInTheDocument(); + expect(screen.getByText("50.00 %")).toBeInTheDocument(); + expect(screen.getByText("60.00 %")).toBeInTheDocument(); expect(screen.getByText("10 %")).toBeInTheDocument(); expect(screen.getByText("20 %")).toBeInTheDocument(); expect(screen.getByText("$2,500.00")).toBeInTheDocument();