Skip to content

test: add failing test for unresolvable path expression#97

Closed
barinali wants to merge 1 commit intomainfrom
issue-87
Closed

test: add failing test for unresolvable path expression#97
barinali wants to merge 1 commit intomainfrom
issue-87

Conversation

@barinali
Copy link
Contributor

Related to #87

Path FEEL expressions like =agent.context on an Any-typed variable incorrectly resolve as null with Null type instead of Any.

Proposed Changes

This pull request aims to provide red test coverage for the #87 as there is no test coverage for the reported bug.

Checklist

Ensure you provide everything we need to review your contribution:

  • Contribution meets our definition of done
  • Pull request establishes context
    • Link to related issue(s), i.e. Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}
    • Brief textual description of the changes
    • Screenshots or short videos showing UI/UX changes
    • Steps to try out, i.e. using the @bpmn-io/sr tool

Related to #87

Path FEEL expressions like `=agent.context` on an `Any`-typed variable
incorrectly resolve as `null` with `Null` type instead of `Any`.
@barinali barinali requested a review from nikku March 13, 2026 13:53
@barinali barinali self-assigned this Mar 13, 2026
@barinali barinali requested review from a team, AlekseyManetov and Copilot March 13, 2026 13:53
@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Mar 13, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Zeebe mapping fixture and a corresponding spec to reproduce issue #87, where an unresolvable FEEL path expression (e.g. =agent.context) is currently resolved as null/Null instead of staying Any with the original expression preserved in info.

Changes:

  • Add a new BPMN fixture containing an input mapping =agent.context and an output mapping =agent.
  • Add a new test case asserting agentContext should be typed as Any and keep info: '=agent.context'.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
test/spec/zeebe/Mappings.spec.js Adds a spec case that captures the expected behavior for unresolvable path expressions (issue #87).
test/fixtures/zeebe/mappings/unresolvable-path-expression.bpmn Introduces a minimal diagram fixture to reproduce the unresolvable path expression scenario.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +483 to +505
it('should resolve unresolvable path expression as <Any>', 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'
}
]);
}));
@barinali
Copy link
Contributor Author

closing this in favor of #98

@barinali barinali closed this Mar 16, 2026
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Mar 16, 2026
@nikku nikku deleted the issue-87 branch March 16, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants