From 834daf27194b854df15eafb87c23d12106640972 Mon Sep 17 00:00:00 2001 From: zachery with an e <45150570+zweatshirt@users.noreply.github.com> Date: Tue, 19 May 2026 14:44:02 -0500 Subject: [PATCH] Add validation for required salary cap fields in MaxAllowableStep --- .../MaxAllowableSection.test.tsx | 19 +++++++++++++++++++ .../MaxAllowableSection.tsx | 2 ++ 2 files changed, 21 insertions(+) diff --git a/src/components/HrTools/SalaryCalculator/YourInformation/MaxAllowableSection/MaxAllowableSection.test.tsx b/src/components/HrTools/SalaryCalculator/YourInformation/MaxAllowableSection/MaxAllowableSection.test.tsx index 30df8df6d5..75a65d3d37 100644 --- a/src/components/HrTools/SalaryCalculator/YourInformation/MaxAllowableSection/MaxAllowableSection.test.tsx +++ b/src/components/HrTools/SalaryCalculator/YourInformation/MaxAllowableSection/MaxAllowableSection.test.tsx @@ -165,6 +165,25 @@ describe('MaxAllowableSection', () => { 'Your combined maximum allowable salary exceeds your maximum allowable salary of $125,000.00', ); }); + + it('shows required errors when split cap fields are empty', async () => { + const { findByText } = render( + , + ); + + expect( + await findByText('Maximum Allowable Salary is required'), + ).toBeInTheDocument(); + expect( + await findByText('Spouse Maximum Allowable Salary is required'), + ).toBeInTheDocument(); + }); }); it('shows message to users with exception cap', async () => { diff --git a/src/components/HrTools/SalaryCalculator/YourInformation/MaxAllowableSection/MaxAllowableSection.tsx b/src/components/HrTools/SalaryCalculator/YourInformation/MaxAllowableSection/MaxAllowableSection.tsx index a4b91e39a5..a17d3d9020 100644 --- a/src/components/HrTools/SalaryCalculator/YourInformation/MaxAllowableSection/MaxAllowableSection.tsx +++ b/src/components/HrTools/SalaryCalculator/YourInformation/MaxAllowableSection/MaxAllowableSection.tsx @@ -70,10 +70,12 @@ export const MaxAllowableStep: React.FC = () => { return yup.object({ salaryCap: amount(t('Maximum Allowable Salary'), t, { + required: true, max: calculations?.hardCap, maxMessage, }), spouseSalaryCap: amount(t('Spouse Maximum Allowable Salary'), t, { + required: true, max: calculations?.hardCap, maxMessage, }),