Skip to content

Commit 2dd8b05

Browse files
committed
test: make edited indicator test more robust
1 parent 0f2d030 commit 2dd8b05

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

test/spec/provider/zeebe/ScriptImplementationProps.spec.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ describe('provider/zeebe - ScriptImplementationProps', function() {
114114
// then
115115
const implementation = getImplementationSelect(container);
116116
expect(implementation.value).to.equal('');
117-
expectEditedIndicator(container).to.not.exist;
117+
118+
// and also
119+
return expectEdited(container, false);
118120
}));
119121

120122

@@ -131,7 +133,9 @@ describe('provider/zeebe - ScriptImplementationProps', function() {
131133
// then
132134
const implementation = getImplementationSelect(container);
133135
expect(implementation.value).to.equal('script');
134-
expectEditedIndicator(container).to.exist;
136+
137+
// and also
138+
return expectEdited(container, true);
135139
}));
136140

137141

@@ -148,7 +152,9 @@ describe('provider/zeebe - ScriptImplementationProps', function() {
148152
// then
149153
const implementation = getImplementationSelect(container);
150154
expect(implementation.value).to.equal('jobWorker');
151-
expectEditedIndicator(container).to.exist;
155+
156+
// and also
157+
return expectEdited(container, true);
152158
}));
153159

154160

@@ -172,7 +178,6 @@ describe('provider/zeebe - ScriptImplementationProps', function() {
172178

173179
const script = getScript(scriptTask);
174180
expect(script).to.not.exist;
175-
176181
}));
177182

178183

@@ -319,10 +324,18 @@ describe('provider/zeebe - ScriptImplementationProps', function() {
319324

320325
// helper /////////////////
321326

322-
function expectEditedIndicator(container) {
327+
async function expectEdited(container, exists) {
328+
await new Promise(resolve => {
329+
setTimeout(resolve, 0);
330+
});
331+
323332
const indicator = domQuery(`${GROUP_SELECTOR} .bio-properties-panel-dot`, container);
324333

325-
return expect(indicator);
334+
if (exists) {
335+
expect(indicator).to.exist;
336+
} else {
337+
expect(indicator).not.to.exist;
338+
}
326339
}
327340

328341
function getImplementationSelect(container) {

0 commit comments

Comments
 (0)