Skip to content

Commit

Permalink
test: verify optional entry change
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku authored and fake-join[bot] committed Sep 1, 2022
1 parent f85db35 commit cb9be46
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
<zeebe:output source="output-1-source" target="output-1-target" />
<zeebe:output source="output-2-source" target="output-2-target" />
</zeebe:ioMapping>
<zeebe:properties>
<zeebe:property name="property-1" value="property-1-value" />
<zeebe:property name="property-2" value="property-2-value" />
<zeebe:property name="property-3" value="property-3-value" />
</zeebe:properties>
</bpmn:extensionElements>
</bpmn:serviceTask>
</bpmn:process>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,31 @@
"type": "zeebe:output",
"source": "output-3-source"
}
},
{
"type": "String",
"value": "property-1-value",
"binding": {
"type": "zeebe:property",
"name": "property-1"
}
},
{
"type": "String",
"value": "property-2-value",
"optional": true,
"binding": {
"type": "zeebe:property",
"name": "property-2"
}
},
{
"type": "String",
"optional": true,
"binding": {
"type": "zeebe:property",
"name": "property-3"
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,52 @@ describe('provider/cloud-element-templates - CustomProperties', function() {
});
});


it('should keep property (non optional)', inject(async function() {

// given
const task = await expectSelected('RestTask'),
businessObject = getBusinessObject(task);

// when
const entry = findEntry('custom-entry-com.example.rest-7', container),
input = findInput('text', entry);

changeInput(input, '');

// then
const zeebeProperties = findExtension(businessObject, 'zeebe:Properties'),
zeebeProperty = findZeebeProperty(zeebeProperties, { name: 'property-1-name' });

expect(zeebeProperty).to.exist;
expect(zeebeProperty).to.jsonEqual({
$type: 'zeebe:Property',
name: 'property-1-name',
value: ''
});
}));


it('should not keep property (optional)', inject(async function() {

// given
const task = await expectSelected('RestTask_optional'),
businessObject = getBusinessObject(task);

// when
const entry = findEntry('custom-entry-com.example.rest-optional-8', container),
input = findInput('text', entry);

changeInput(input, '');

// then
const zeebeProperties = findExtension(businessObject, 'zeebe:Properties'),
zeebeProperty = findZeebeProperty(zeebeProperties, { name: 'property-3-name' });

// then
expect(zeebeProperty).not.to.exist;
}));

});


Expand Down

0 comments on commit cb9be46

Please sign in to comment.