diff --git a/src/openforms/formio/tests/validation/test_checkbox.py b/src/openforms/formio/tests/validation/test_checkbox.py index ac73477528..1d88a84ae5 100644 --- a/src/openforms/formio/tests/validation/test_checkbox.py +++ b/src/openforms/formio/tests/validation/test_checkbox.py @@ -18,6 +18,7 @@ def test_checkbox_field_required_validation(self): ({}, "required"), ({"foo": ""}, "invalid"), ({"foo": None}, "null"), + ({"foo": False}, "invalid"), ] for data, error_code in invalid_values: diff --git a/src/openforms/tests/e2e/test_input_validation.py b/src/openforms/tests/e2e/test_input_validation.py index b5c1dbf564..c92a503f7f 100644 --- a/src/openforms/tests/e2e/test_input_validation.py +++ b/src/openforms/tests/e2e/test_input_validation.py @@ -322,9 +322,7 @@ def test_max_date_fixed_value(self): class SingleCheckboxTests(ValidationsTestCase): async def apply_ui_input(self, page: Page, label: str, ui_input: str | int | float): - await expect( - page.get_by_role("checkbox", name="Required checkbox") - ).not_to_be_checked() + await expect(page.get_by_role("checkbox", name=label)).not_to_be_checked() def test_required_field(self): component: Component = { @@ -388,8 +386,8 @@ def test_max_value(self): class SingleMapTests(ValidationsTestCase): async def apply_ui_input(self, page: Page, label: str, ui_input: str | int | float): - page.wait_for_selector( - ".openforms-leaflet-map, [aria-label='Required map']", state="visible" + await page.wait_for_selector( + f".openforms-leaflet-map, [aria-label='{label}']", state="visible" ) def test_required_field(self): @@ -426,7 +424,7 @@ def test_required_field(self): class SingleSignatureTests(ValidationsTestCase): async def apply_ui_input(self, page: Page, label: str, ui_input: str | int | float): - page.wait_for_selector("[aria-label='Required signature']", state="visible") + page.wait_for_selector(f"[aria-label='{label}']", state="visible") def test_required_field(self): component: Component = { @@ -470,7 +468,6 @@ def test_max_length(self): self.assertValidationIsAligned( component, ui_input=invalid_sample, - api_value=invalid_sample, expected_ui_error="Er zijn teveel karakters opgegeven.", ) @@ -523,3 +520,20 @@ def test_max_value(self): ui_input="12:10", expected_ui_error="Alleen tijden tussen 10:00 en 12:00 zijn toegestaan.", ) + + def test_min_max_special_logic(self): + component: Component = { + "type": "time", + "key": "requiredTime", + "label": "Required time", + "validate": { + "minTime": "20:00", + "maxTime": "04:00", + }, + } + + self.assertValidationIsAligned( + component, + ui_input="15:00", + expected_ui_error="Alleen tijden tussen 20:00 en 04:00 zijn toegestaan.", + )