From 6f95c86c8cfaf36178fae12c5cdfe3dd6288a56e Mon Sep 17 00:00:00 2001 From: James Wainwright Date: Mon, 3 Feb 2025 17:01:50 +0000 Subject: [PATCH] Add length validation to name fields and refactor error state logic --- components/GovCheckboxes.vue | 11 +- components/GovDropdown.vue | 10 +- components/GovInputInt.vue | 11 +- components/GovInputText.vue | 11 +- components/GovInputWithSuffix.vue | 11 +- components/GovRadios.vue | 4 +- .../hot-water-distribution/[distribution].vue | 2 +- .../shading/shading-form.test.ts | 2 + pages/dwelling-details/summary.test.ts | 2 +- utils/validation.test.ts | 150 ++++++++++++++++++ utils/validation.ts | 17 ++ 11 files changed, 183 insertions(+), 48 deletions(-) create mode 100644 utils/validation.test.ts create mode 100644 utils/validation.ts diff --git a/components/GovCheckboxes.vue b/components/GovCheckboxes.vue index ff61189..f8512dc 100644 --- a/components/GovCheckboxes.vue +++ b/components/GovCheckboxes.vue @@ -35,14 +35,7 @@ const handleChange = (value: string) => {