From ea016df40180c0ade57775032b9ceb294cce1265 Mon Sep 17 00:00:00 2001 From: Ali Barin Date: Fri, 13 Mar 2026 11:37:20 +0100 Subject: [PATCH] test: add failing test for unresolvable path expression Related to #87 Path FEEL expressions like `=agent.context` on an `Any`-typed variable incorrectly resolve as `null` with `Null` type instead of `Any`. --- .../unresolvable-path-expression.bpmn | 21 ++++++++++++ test/spec/zeebe/Mappings.spec.js | 33 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 test/fixtures/zeebe/mappings/unresolvable-path-expression.bpmn diff --git a/test/fixtures/zeebe/mappings/unresolvable-path-expression.bpmn b/test/fixtures/zeebe/mappings/unresolvable-path-expression.bpmn new file mode 100644 index 0000000..9b96d9d --- /dev/null +++ b/test/fixtures/zeebe/mappings/unresolvable-path-expression.bpmn @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/test/spec/zeebe/Mappings.spec.js b/test/spec/zeebe/Mappings.spec.js index 1c4a6e8..924edac 100644 --- a/test/spec/zeebe/Mappings.spec.js +++ b/test/spec/zeebe/Mappings.spec.js @@ -24,6 +24,7 @@ import propagationXML from 'test/fixtures/zeebe/mappings/propagation.bpmn'; import scriptTaskXML from 'test/fixtures/zeebe/mappings/script-task.bpmn'; import scriptTaskEmptyExpressionXML from 'test/fixtures/zeebe/mappings/script-task-empty-expression.bpmn'; import scriptTaskOutputNoNameXML from 'test/fixtures/zeebe/mappings/script-task-output-no-name.bpmn'; +import unresolvablePathExpressionXML from 'test/fixtures/zeebe/mappings/unresolvable-path-expression.bpmn'; import VariableProvider from 'lib/VariableProvider'; @@ -474,6 +475,38 @@ describe('ZeebeVariableResolver - Variable Mappings', function() { }); + describe('Unresolvable path expression', function() { + + beforeEach(bootstrap(unresolvablePathExpressionXML)); + + + it('should resolve unresolvable path expression as ', inject(async function(variableResolver, elementRegistry) { + + // given + const subProcess = elementRegistry.get('SubProcess_1'); + + // when + const variables = await variableResolver.getVariablesForElement(subProcess); + + // then + // cf. https://github.com/bpmn-io/variable-resolver/issues/87 + expect(variables).to.variableEqual([ + { + name: 'agentContext', + type: 'Any', + info: '=agent.context' + }, + { + name: 'agent', + type: 'Any', + info: '=agent' + } + ]); + })); + + }); + + describe('Scope', function() { beforeEach(bootstrap(scopeXML));