From 13cc356e272820b6e81f9df8c46d826f79456818 Mon Sep 17 00:00:00 2001
From: zachery with an e <45150570+zweatshirt@users.noreply.github.com>
Date: Tue, 19 May 2026 15:07:12 -0500
Subject: [PATCH] Add conditional rendering for Pay Rate field based on pay
type
---
.../Setup/SetupStep.test.tsx | 16 ++++++++++
.../PdsGoalCalculator/Setup/SetupStep.tsx | 30 ++++++++++---------
2 files changed, 32 insertions(+), 14 deletions(-)
diff --git a/src/components/HrTools/PdsGoalCalculator/Setup/SetupStep.test.tsx b/src/components/HrTools/PdsGoalCalculator/Setup/SetupStep.test.tsx
index a667553266..cf3f404a85 100644
--- a/src/components/HrTools/PdsGoalCalculator/Setup/SetupStep.test.tsx
+++ b/src/components/HrTools/PdsGoalCalculator/Setup/SetupStep.test.tsx
@@ -170,6 +170,22 @@ describe('SetupStep', () => {
);
});
+ it('hides Pay Rate when pay type is not set', async () => {
+ const { findByRole, queryByRole } = renderSetup({
+ calculationMock: {
+ ...fullTimeSalariedMock,
+ salaryOrHourly: null,
+ payRate: null,
+ },
+ });
+
+ await findByRole('textbox', { name: 'Goal Name' });
+
+ expect(
+ queryByRole('spinbutton', { name: 'Pay Rate' }),
+ ).not.toBeInTheDocument();
+ });
+
it('shows dynamic Pay Rate helper text based on salary type', async () => {
const { findByRole, findByText, rerender } = renderSetup({
calculationMock: fullTimeSalariedMock,
diff --git a/src/components/HrTools/PdsGoalCalculator/Setup/SetupStep.tsx b/src/components/HrTools/PdsGoalCalculator/Setup/SetupStep.tsx
index 29acf5267b..ac4ba6cea4 100644
--- a/src/components/HrTools/PdsGoalCalculator/Setup/SetupStep.tsx
+++ b/src/components/HrTools/PdsGoalCalculator/Setup/SetupStep.tsx
@@ -92,8 +92,8 @@ export const SetupStep: React.FC = () => {
return `${location} (${percentageFormat(multiplier, locale)})`;
};
- const isSalaried =
- calculation?.salaryOrHourly === DesignationSupportSalaryType.Salaried;
+ const payType = calculation?.salaryOrHourly;
+ const isSalaried = payType === DesignationSupportSalaryType.Salaried;
const isPartTime = calculation?.status === DesignationSupportStatus.PartTime;
const isSimpleForm =
calculation?.formType === DesignationSupportFormType.Simple;
@@ -230,18 +230,20 @@ export const SetupStep: React.FC = () => {
-
- ,
- }}
- />
-
+ {payType && (
+
+ ,
+ }}
+ />
+
+ )}
{!isSalaried && (