diff --git a/tests/data/enum_value_expression_fail/Decision_Value_Expression.dmn b/tests/data/enum_value_expression_fail/Decision_Value_Expression.dmn new file mode 100644 index 00000000..11c7beba --- /dev/null +++ b/tests/data/enum_value_expression_fail/Decision_Value_Expression.dmn @@ -0,0 +1,40 @@ + + + + + + + + + + user_input + + + + + + True + + + 'black' + + + + + False + + + 'white' + + + + + + + + 'grey' + + + + + diff --git a/tests/data/enum_value_expression_fail/enum_value_expression_fail.bpmn b/tests/data/enum_value_expression_fail/enum_value_expression_fail.bpmn new file mode 100644 index 00000000..ddbfc613 --- /dev/null +++ b/tests/data/enum_value_expression_fail/enum_value_expression_fail.bpmn @@ -0,0 +1,95 @@ + + + + + Flow_02xzhf3 + + + + + + + + + + + Flow_02xzhf3 + Flow_0d46qnz + + + Flow_0d46qnz + Flow_1d7sv9v + + + <h1>Hello {{ lookup_output }}</h1> + + + + + + + + + + + + + + Flow_1d7sv9v + Flow_01x96w8 + + + + <h1>Hello</h1> +<div>You picked {{ color_select.label }}</div> + Flow_01x96w8 + Flow_05tzoiy + + + Flow_05tzoiy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/workflow/test_workflow_enum_default_value_expression.py b/tests/workflow/test_workflow_enum_default_value_expression.py index d7ab0d37..00c2abf6 100644 --- a/tests/workflow/test_workflow_enum_default_value_expression.py +++ b/tests/workflow/test_workflow_enum_default_value_expression.py @@ -1,4 +1,5 @@ from tests.base_test import BaseTest +import json class TestWorkflowEnumDefault(BaseTest): @@ -36,3 +37,10 @@ class TestWorkflowEnumDefault(BaseTest): workflow_api = self.get_workflow_api(workflow) self.assertEqual('Activity_PickColor', self.get_workflow_api(workflow_api).next_task.name) self.assertEqual({'value': 'white', 'label': 'White'}, workflow_api.next_task.data['color_select']) + + def test_enum_value_expression_and_default(self): + spec_model = self.load_test_spec('enum_value_expression_fail') + rv = self.app.get('/v1.0/workflow-specification/%s/validate' % spec_model.id, headers=self.logged_in_headers()) + + json_data = json.loads(rv.get_data(as_text=True)) + self.assertEqual(json_data[0]['code'], 'default value and value_expression')