|
| 1 | +import unittest |
| 2 | + |
1 | 3 | from django.test import TestCase, tag
|
2 | 4 |
|
3 | 5 | from openforms.forms.constants import LogicActionTypes
|
@@ -874,6 +876,43 @@ def test_component_visible_in_frontend(self):
|
874 | 876 | "Some data that must not be cleared!", submission_step.data["textField"]
|
875 | 877 | )
|
876 | 878 |
|
| 879 | + # TODO-5139: this is a bug which currently exists on master as well, and is not |
| 880 | + # fixed with the data-structure changes, yet. |
| 881 | + @unittest.expectedFailure |
| 882 | + def test_component_visible_with_date(self): |
| 883 | + form = FormFactory.create() |
| 884 | + form_step = FormStepFactory.create( |
| 885 | + form=form, |
| 886 | + form_definition__configuration={ |
| 887 | + "components": [ |
| 888 | + { |
| 889 | + "key": "date", |
| 890 | + "type": "date", |
| 891 | + }, |
| 892 | + { |
| 893 | + "type": "textfield", |
| 894 | + "key": "textField", |
| 895 | + "hidden": True, |
| 896 | + "conditional": {"eq": "2025-01-01", "show": True, "when": "date"}, |
| 897 | + "clearOnHide": True, |
| 898 | + }, |
| 899 | + ] |
| 900 | + }, |
| 901 | + ) |
| 902 | + |
| 903 | + submission = SubmissionFactory.create(form=form) |
| 904 | + submission_step = SubmissionStepFactory.create( |
| 905 | + submission=submission, |
| 906 | + form_step=form_step, |
| 907 | + data={"date": "2025-01-01", "textField": "Some data that must not be cleared!"}, |
| 908 | + ) |
| 909 | + |
| 910 | + evaluate_form_logic(submission, submission_step, submission.data, dirty=True) |
| 911 | + |
| 912 | + self.assertEqual( |
| 913 | + "Some data that must not be cleared!", submission_step.data["textField"] |
| 914 | + ) |
| 915 | + |
877 | 916 | @tag("gh-1183")
|
878 | 917 | def test_component_incomplete_frontend_logic(self):
|
879 | 918 | form = FormFactory.create()
|
|
0 commit comments