diff --git a/frontend/src/pages/ActivityReport/Pages/activitySummary.js b/frontend/src/pages/ActivityReport/Pages/activitySummary.js index 930851cca8..3dccf181e4 100644 --- a/frontend/src/pages/ActivityReport/Pages/activitySummary.js +++ b/frontend/src/pages/ActivityReport/Pages/activitySummary.js @@ -45,6 +45,7 @@ const ActivitySummary = ({ const disableRecipients = activityRecipientType === ''; const nonGranteeSelected = activityRecipientType === 'non-grantee'; + const granteeSelected = activityRecipientType === 'grantee'; const selectedRecipients = nonGranteeSelected ? nonGrantees : grants; const previousActivityRecipientType = useRef(activityRecipientType); const recipientLabel = nonGranteeSelected ? 'Non-grantee name(s)' : 'Grantee name(s)'; @@ -55,6 +56,7 @@ const ActivitySummary = ({ if (previousActivityRecipientType.current !== activityRecipientType) { setValue('activityRecipients', []); setValue('participants', []); + setValue('programTypes', []); previousActivityRecipientType.current = activityRecipientType; } }, [activityRecipientType, setValue]); @@ -123,6 +125,8 @@ const ActivitySummary = ({ options={collaborators.map((user) => ({ value: user.id, label: user.name }))} /> + {granteeSelected + && (
({ value: pt, label: pt }))} />
+ )}
{ }); }); + it('program type is hidden unless grantee is selected', async () => { + renderActivityReport('new'); + const information = await screen.findByRole('group', { name: 'Who was the activity for?' }); + await waitFor(() => expect(screen.queryByLabelText('Program type(s)')).toBeNull()); + const nonGrantee = within(information).getByLabelText('Grantee'); + fireEvent.click(nonGrantee); + await waitFor(() => expect(screen.queryByLabelText('Program type(s)')).toBeVisible()); + }); + it('defaults to activity summary if no page is in the url', async () => { renderActivityReport('new', null); await waitFor(() => expect(history.location.pathname).toEqual('/activity-reports/new/activity-summary')); diff --git a/frontend/src/pages/ActivityReport/constants.js b/frontend/src/pages/ActivityReport/constants.js index ae072c8922..3e9cc9984d 100644 --- a/frontend/src/pages/ActivityReport/constants.js +++ b/frontend/src/pages/ActivityReport/constants.js @@ -55,11 +55,9 @@ export const targetPopulations = [ ]; export const programTypes = [ - 'program type 1', - 'program type 2', - 'program type 3', - 'program type 4', - 'program type 5', + 'Early Head Start (ages 0-3)', + 'Head Start (ages 3-5)', + 'EHS-CCP', ]; export const topics = [