@@ -14,6 +14,7 @@ import complexXML from 'test/fixtures/zeebe/complex.bpmn';
1414import connectorsXML from 'test/fixtures/zeebe/connectors.bpmn' ;
1515import ioMappingsXML from 'test/fixtures/zeebe/ioMappings.bpmn' ;
1616import longBrokenExpressionXML from 'test/fixtures/zeebe/long-broken-expression.bpmn' ;
17+ import immediatelyBrokenExpressionXML from 'test/fixtures/zeebe/immediately-broken-expression.bpmn' ;
1718
1819import VariableProvider from 'lib/VariableProvider' ;
1920import { getInputOutput } from '../../../lib/base/util/ExtensionElementsUtil' ;
@@ -1043,32 +1044,65 @@ describe('ZeebeVariableResolver', function() {
10431044
10441045 describe ( 'parsing' , function ( ) {
10451046
1046- beforeEach ( bootstrapModeler ( longBrokenExpressionXML , {
1047- container,
1048- additionalModules : [
1049- ZeebeVariableResolverModule
1050- ] ,
1051- moddleExtensions : {
1052- zeebe : ZeebeModdle
1053- }
1054- } ) ) ;
1047+ describe ( 'long broken expression' , function ( ) {
10551048
1049+ beforeEach ( bootstrapModeler ( longBrokenExpressionXML , {
1050+ container,
1051+ additionalModules : [
1052+ ZeebeVariableResolverModule
1053+ ] ,
1054+ moddleExtensions : {
1055+ zeebe : ZeebeModdle
1056+ }
1057+ } ) ) ;
10561058
1057- it ( 'should NOT error on a long broken expression' , inject ( async function ( elementRegistry , variableResolver ) {
10581059
1059- // given
1060- const task = elementRegistry . get ( 'Task_1' ) ;
1061- const bo = getBusinessObject ( task ) ;
1062- const input = getInputOutput ( bo ) . inputParameters [ 1 ] ;
1060+ it ( 'should NOT error on a long broken expression' , inject ( async function ( elementRegistry , variableResolver ) {
10631061
1064- // when
1065- const variables = await variableResolver . getVariablesForElement ( bo , input ) ;
1062+ // given
1063+ const task = elementRegistry . get ( 'Task_1' ) ;
1064+ const bo = getBusinessObject ( task ) ;
10661065
1067- // then
1068- expect ( variables ) . to . variableEqual ( [
1069- { name : 'target' }
1070- ] ) ;
1071- } ) ) ;
1066+ // when
1067+ const variables = await variableResolver . getVariablesForElement ( bo ) ;
1068+
1069+ // then
1070+ expect ( variables ) . to . variableEqual ( [
1071+ { name : 'target' }
1072+ ] ) ;
1073+ } ) ) ;
1074+
1075+ } ) ;
1076+
1077+
1078+ describe ( 'immediately broken expression' , function ( ) {
1079+
1080+ beforeEach ( bootstrapModeler ( immediatelyBrokenExpressionXML , {
1081+ container,
1082+ additionalModules : [
1083+ ZeebeVariableResolverModule
1084+ ] ,
1085+ moddleExtensions : {
1086+ zeebe : ZeebeModdle
1087+ }
1088+ } ) ) ;
1089+
1090+
1091+ it ( 'should NOT error on an immediate syntax error' , inject ( async function ( elementRegistry , variableResolver ) {
1092+
1093+ // given
1094+ const task = elementRegistry . get ( 'Task_2' ) ;
1095+ const bo = getBusinessObject ( task ) ;
1096+
1097+ // when
1098+ const variables = await variableResolver . getVariablesForElement ( bo ) ;
1099+
1100+ // then
1101+ expect ( variables ) . to . variableEqual ( [
1102+ { name : 'target' }
1103+ ] ) ;
1104+ } ) ) ;
1105+ } ) ;
10721106 } ) ;
10731107
10741108} ) ;
0 commit comments