diff --git a/src/components/input/WebsiteValueComboBox.test.tsx b/src/components/input/WebsiteValueComboBox.test.tsx index 0dd6cf51d..1b1927864 100644 --- a/src/components/input/WebsiteValueComboBox.test.tsx +++ b/src/components/input/WebsiteValueComboBox.test.tsx @@ -65,7 +65,7 @@ test('clears the selected website value when the input is cleared', () => { expect(onChange).toHaveBeenCalledWith(''); }); -test('combines values from both Journey step types', () => { +test('combines values from both Journey step types with the typed value', () => { render( { additionalType="event" startDate={new Date('2026-08-01')} endDate={new Date('2026-08-03')} - value="" + value="/" onChange={() => {}} />, ); + expect(screen.getByText('/')).toBeInTheDocument(); expect(screen.getByText('/home')).toBeInTheDocument(); expect(screen.getByText('signup')).toBeInTheDocument(); }); diff --git a/src/components/input/WebsiteValueComboBox.tsx b/src/components/input/WebsiteValueComboBox.tsx index fc9b5120a..6c8b56baf 100644 --- a/src/components/input/WebsiteValueComboBox.tsx +++ b/src/components/input/WebsiteValueComboBox.tsx @@ -56,12 +56,14 @@ export function WebsiteValueComboBox({ }, [type, additionalType]); const items = useMemo(() => { - const values = [...(primaryQuery.data || []), ...(additionalQuery.data || [])] - .map(({ value }) => value) - .filter(Boolean); + const values = [ + value, + ...(primaryQuery.data || []).map(({ value }) => value), + ...(additionalQuery.data || []).map(({ value }) => value), + ].filter(Boolean); return [...new Set(values)]; - }, [primaryQuery.data, additionalQuery.data]); + }, [value, primaryQuery.data, additionalQuery.data]); return (