Skip to content

Commit b6c48fe

Browse files
nikkufake-join[bot]
authored andcommitted
test(zeebe): verify user task edited state
1 parent e831227 commit b6c48fe

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

test/spec/provider/zeebe/UserTaskImplementationProps.spec.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ import zeebeModdleExtensions from 'zeebe-bpmn-moddle/resources/zeebe';
3434

3535
import diagramXML from './UserTaskImplementationProps.bpmn';
3636

37+
const GROUP_SELECTOR = '[data-group-id="group-userTaskImplementation"]';
38+
const IMPLEMENTATION_SELECTOR = 'select[name=userTaskImplementation]';
39+
3740

3841
describe('provider/zeebe - UserTaskImplementationProps', function() {
3942

@@ -110,6 +113,9 @@ describe('provider/zeebe - UserTaskImplementationProps', function() {
110113
// then
111114
const implementation = getImplementationSelect(container);
112115
expect(implementation.value).to.equal('zeebeUserTask');
116+
117+
// and also
118+
return expectEdited(container, true);
113119
}));
114120

115121

@@ -126,6 +132,9 @@ describe('provider/zeebe - UserTaskImplementationProps', function() {
126132
// then
127133
const implementation = getImplementationSelect(container);
128134
expect(implementation.value).to.equal('jobWorker');
135+
136+
// and also
137+
return expectEdited(container, false);
129138
}));
130139

131140

@@ -223,11 +232,29 @@ describe('provider/zeebe - UserTaskImplementationProps', function() {
223232
// helper /////////////////
224233

225234
function getImplementationSelect(container) {
226-
return domQuery('select[name=userTaskImplementation]', container);
235+
return domQuery(IMPLEMENTATION_SELECTOR, container);
227236
}
228237

229238
function getZeebeUserTask(element) {
230239
const businessObject = getBusinessObject(element);
231240

232241
return getExtensionElementsList(businessObject, 'zeebe:UserTask')[0];
233242
}
243+
244+
245+
async function expectEdited(container, exists) {
246+
247+
await wait(50);
248+
249+
const indicator = domQuery(`${GROUP_SELECTOR} .bio-properties-panel-dot`, container);
250+
251+
if (exists) {
252+
expect(indicator).to.exist;
253+
} else {
254+
expect(indicator).not.to.exist;
255+
}
256+
}
257+
258+
function wait(ms) {
259+
return new Promise(resolve => setTimeout(resolve, ms));
260+
}

0 commit comments

Comments
 (0)