Skip to content

test: assert quotations for string variables#94

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

test: assert quotations for string variables#94
barinali wants to merge 1 commit intomainfrom
issue-88

Conversation

@barinali
Copy link
Contributor

Proposed Changes

This pull request aims to provide red test coverage for the #88 as the current tests are false positive.

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

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 stricter test assertions to ensure string variable info values are consistently serialized with surrounding quotes, addressing false-positive coverage related to #88 (inconsistent string serialization).

Changes:

  • Update ZeebeVariableResolver specs to assert quoted info for string literals, static inputs, and path-resolved string values.
  • Update mapping specs to assert quoted info for string-typed primitive entries and script/output mapping results.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
test/spec/zeebe/ZeebeVariableResolver.spec.js Tightens assertions for string info quoting across static inputs, literal outputs, and path expressions.
test/spec/zeebe/Mappings.spec.js Tightens assertions for string info quoting in primitive mapping results and scope/mapping scenarios.

💡 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 +2040 to +2041
{ name: 'staticInput', type: 'String', scope: 'ServiceTask_1', info: '"YES"' },
{ name: 'otherStaticInput', type: 'String', scope: 'ServiceTask_1', info: '""YES""""' }
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

These assertions change the expected info for string variables from unquoted (e.g. YES) to quoted (e.g. "YES"). Since this PR only updates tests (no corresponding serialization change in the resolver), this will make the existing test suite fail unless the implementation is updated in the same PR or the tests are explicitly marked as pending/red (e.g. it.skip) until the fix lands.

Suggested change
{ name: 'staticInput', type: 'String', scope: 'ServiceTask_1', info: '"YES"' },
{ name: 'otherStaticInput', type: 'String', scope: 'ServiceTask_1', info: '""YES""""' }
{ name: 'staticInput', type: 'String', scope: 'ServiceTask_1', info: 'YES' },
{ name: 'otherStaticInput', type: 'String', scope: 'ServiceTask_1', info: '""YES""' }

Copilot uses AI. Check for mistakes.
Comment on lines +2040 to 2042
{ name: 'staticInput', type: 'String', scope: 'ServiceTask_1', info: '"YES"' },
{ name: 'otherStaticInput', type: 'String', scope: 'ServiceTask_1', info: '""YES""""' }
]);
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The expected value for otherStaticInput (""YES"""") is very hard to read and easy to get wrong when adjusting tests later. Consider factoring this into a clearly named helper/constant that documents what is being asserted (e.g. raw-value-wrapped-in-quotes vs escaped FEEL literal), so the intent of the quoting behavior is unambiguous.

Copilot uses AI. Check for mistakes.
Comment on lines 158 to 165
{
name: 'genericTypes',
type: 'Context',
info: '',
entries: [
{ name: 'string', type: 'String', info: 'foo', entries: [] },
{ name: 'string', type: 'String', info: '"foo"', entries: [] },
{ name: 'number', type: 'Number', info: '1', entries: [] },
{ name: 'booleanTrue', type: 'Boolean', info: 'true', entries: [] },
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

These updated expectations require string info values to include surrounding quotes (e.g. "foo", "1"). If the resolver still derives info from the raw atomic string value, these tests will fail without a matching implementation change; consider pairing this with the serialization fix in the same PR (or marking the tests as intentionally red/pending).

Copilot uses AI. Check for mistakes.
@nikku
Copy link
Member

nikku commented Mar 16, 2026

Incorporated into #95

@nikku nikku 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-88 branch March 16, 2026 21:55
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.

3 participants