Skip to content

Commit

Permalink
test(cloud-element-templates): verify no visual Dropdown selection
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Dec 14, 2022
1 parent 882f013 commit cc4a3b7
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</bpmn:extensionElements>
</bpmn:serviceTask>
<bpmn:serviceTask id="RestTask_optional" name="optional" zeebe:modelerTemplate="com.example.rest-optional">
<bpmn:extensionElements>
<bpmn:extensionElements>
<zeebe:ioMapping>
<zeebe:input source="input-1-source" target="input-1-target" />
<zeebe:input source="input-2-source" target="input-2-target" />
Expand All @@ -40,6 +40,7 @@
</zeebe:properties>
</bpmn:extensionElements>
</bpmn:serviceTask>
<bpmn:serviceTask id="DropdownNoSelection" name="DropdownNoSelection" zeebe:modelerTemplate="my.example.dropdown-1" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
Expand All @@ -51,6 +52,7 @@
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0sxtp96_di" bpmnElement="DropdownTask">
<dc:Bounds x="220" y="480" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0p6pet6_di" bpmnElement="ValidateTask">
<dc:Bounds x="310" y="200" width="100" height="80" />
Expand All @@ -64,6 +66,10 @@
<bpmndi:BPMNShape id="RestTask_optional_di" bpmnElement="RestTask_optional">
<dc:Bounds x="470" y="200" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0c7o61d_di" bpmnElement="DropdownNoSelection">
<dc:Bounds x="360" y="480" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,29 @@
}
]
},
{
"$schema": "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json",
"name": "Task Template 3",
"id": "my.example.dropdown-1",
"appliesTo": [
"bpmn:ServiceTask"
],
"properties": [
{
"label": "No Value Input",
"type": "Dropdown",
"choices": [
{ "name": "low", "value": "low" },
{ "name": "medium", "value": "medium" },
{ "name": "high", "value": "high" }
],
"binding": {
"type": "zeebe:input",
"name": "noValueInput"
}
}
]
},
{
"$schema": "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json",
"name": "Validated Inputs Task",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,28 @@ describe('provider/cloud-element-templates - CustomProperties', function() {
});


it('should display options (no visual selection)', async function() {

// when
await expectSelected('DropdownNoSelection');

// then
const entry = findEntry('custom-entry-my.example.dropdown-1-0', container),
options = domQueryAll('select option', entry);

expect(Array.from(options).map(({ selected, value }) => {
return {
selected,
value
};
})).to.eql([
{ value: 'low', selected: false },
{ value: 'medium', selected: false },
{ value: 'high', selected: false }
]);
});


it('should change, updating binding', async function() {

// given
Expand Down

0 comments on commit cc4a3b7

Please sign in to comment.