Skip to content

Commit

Permalink
🎨 [#72] Clean up test data/fixtures
Browse files Browse the repository at this point in the history
Use accurate keys/labels for the components being tested.
  • Loading branch information
sergei-maertens committed Mar 29, 2024
1 parent 17e0fbf commit 87bcbd4
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/openforms/tests/e2e/test_input_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ def test_required_field(self):
def test_elfproef_invalid_num_chars(self):
component: Component = {
"type": "bsn",
"key": "requiredBSN",
"label": "Required bsn",
"key": "bsnTooShort",
"label": "BSN too short",
}

self.assertValidationIsAligned(
Expand All @@ -203,8 +203,8 @@ def test_elfproef_invalid_num_chars(self):
def test_elfproef_invalid_bsn(self):
component: Component = {
"type": "bsn",
"key": "requiredBSN",
"label": "Required bsn",
"key": "invalidBSN",
"label": "Invalid bsn",
}
self.assertValidationIsAligned(
component,
Expand Down Expand Up @@ -358,8 +358,8 @@ def test_required_field(self):
def test_min_value(self):
component: Component = {
"type": "currency",
"key": "requiredCurrency",
"label": "Required currency",
"key": "minValueCurrency",
"label": "Min value currency",
"validate": {"min": 10.7},
}

Expand All @@ -372,8 +372,8 @@ def test_min_value(self):
def test_max_value(self):
component: Component = {
"type": "currency",
"key": "requiredCurrency",
"label": "Required currency",
"key": "maxValueCurrency",
"label": "Max value currency",
"validate": {"max": 15},
}

Expand Down Expand Up @@ -461,8 +461,8 @@ def test_required_field(self):
def test_max_length(self):
component: Component = {
"type": "textarea",
"key": "requiredTextarea",
"label": "Required textarea",
"key": "maxLengthTextarea",
"label": "Max length textarea",
"validate": {"maxLength": 10},
}
invalid_sample = "word" * 4
Expand Down Expand Up @@ -492,8 +492,8 @@ def test_required_field(self):
def test_min_value(self):
component: Component = {
"type": "time",
"key": "requiredTime",
"label": "Required time",
"key": "minTime",
"label": "Minimum time",
"validate": {
"minTime": "10:00",
"maxTime": "12:00",
Expand All @@ -509,8 +509,8 @@ def test_min_value(self):
def test_max_value(self):
component: Component = {
"type": "time",
"key": "requiredTime",
"label": "Required time",
"key": "maxTime",
"label": "Maximum time",
"validate": {
"minTime": "10:00",
"maxTime": "12:00",
Expand All @@ -523,11 +523,11 @@ def test_max_value(self):
expected_ui_error="Alleen tijden tussen 10:00 en 12:00 zijn toegestaan.",
)

def test_min_max_special_logic(self):
def test_min_max_crossing_midnight(self):
component: Component = {
"type": "time",
"key": "requiredTime",
"label": "Required time",
"key": "nextDayTime",
"label": "Next day min/max time",
"validate": {
"minTime": "20:00",
"maxTime": "04:00",
Expand Down

0 comments on commit 87bcbd4

Please sign in to comment.