From 0bfe0d63aec83ae438bdcb77e306effd100dba3d Mon Sep 17 00:00:00 2001 From: Jaayden Halko Date: Mon, 11 Aug 2025 20:43:50 +0100 Subject: [PATCH] feat: add tests for dynamic parameters (#18679) ## Summary by CodeRabbit * **New Features** * Added support for a new testing attribute to the multi-select combobox component, improving testability. * Expanded mock data for dynamic parameters, covering a wider range of input types and validation scenarios. * **Bug Fixes** * Improved loader and error handling on the experimental workspace creation page to better display WebSocket errors. * **Tests** * Introduced comprehensive tests for the experimental workspace creation page, including dynamic parameter updates, error handling, and form submission scenarios. --------- Co-authored-by: Michael Smith --- site/src/components/Combobox/Combobox.tsx | 3 + .../MultiSelectCombobox.tsx | 4 + .../DynamicParameter/DynamicParameter.tsx | 6 +- .../CreateWorkspacePageExperimental.test.tsx | 600 ++++++++++++++++++ .../CreateWorkspacePageExperimental.tsx | 13 +- site/src/testHelpers/entities.ts | 189 +++++- 6 files changed, 803 insertions(+), 12 deletions(-) create mode 100644 site/src/pages/CreateWorkspacePage/CreateWorkspacePageExperimental.test.tsx diff --git a/site/src/components/Combobox/Combobox.tsx b/site/src/components/Combobox/Combobox.tsx index f2db25b1ef..35a4846fcf 100644 --- a/site/src/components/Combobox/Combobox.tsx +++ b/site/src/components/Combobox/Combobox.tsx @@ -34,6 +34,7 @@ interface ComboboxProps { onInputChange?: (value: string) => void; onKeyDown?: KeyboardEventHandler; onSelect: (value: string) => void; + id?: string; } type ComboboxOption = { @@ -53,6 +54,7 @@ export const Combobox: FC = ({ onInputChange, onKeyDown, onSelect, + id, }) => { const [managedOpen, setManagedOpen] = useState(false); const [managedInputValue, setManagedInputValue] = useState(""); @@ -78,6 +80,7 @@ export const Combobox: FC = ({