diff --git a/test/spec/provider/zeebe/BusinessRuleImplementationProps.spec.js b/test/spec/provider/zeebe/BusinessRuleImplementationProps.spec.js index d43e58f8..5511ac67 100644 --- a/test/spec/provider/zeebe/BusinessRuleImplementationProps.spec.js +++ b/test/spec/provider/zeebe/BusinessRuleImplementationProps.spec.js @@ -1,7 +1,8 @@ import TestContainer from 'mocha-test-container-support'; import { - act + act, + waitFor } from '@testing-library/preact'; import { @@ -367,19 +368,14 @@ function getTaskHeaders(element) { return getExtensionElementsList(businessObject, 'zeebe:TaskHeaders')[ 0 ]; } -async function expectEdited(container, exists) { +function expectEdited(container, exists) { + return waitFor(() => { + const indicator = domQuery(`${GROUP_SELECTOR} .bio-properties-panel-dot`, container); - await wait(50); - - const indicator = domQuery(`${GROUP_SELECTOR} .bio-properties-panel-dot`, container); - - if (exists) { - expect(indicator).to.exist; - } else { - expect(indicator).not.to.exist; - } + if (exists) { + expect(indicator).to.exist; + } else { + expect(indicator).not.to.exist; + } + }); } - -function wait(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); -} \ No newline at end of file diff --git a/test/spec/provider/zeebe/ScriptImplementationProps.spec.js b/test/spec/provider/zeebe/ScriptImplementationProps.spec.js index 173219de..6418f349 100644 --- a/test/spec/provider/zeebe/ScriptImplementationProps.spec.js +++ b/test/spec/provider/zeebe/ScriptImplementationProps.spec.js @@ -1,7 +1,8 @@ import TestContainer from 'mocha-test-container-support'; import { - act + act, + waitFor } from '@testing-library/preact'; import { @@ -346,19 +347,14 @@ function getTaskHeaders(element) { return getExtensionElementsList(businessObject, 'zeebe:TaskHeaders')[ 0 ]; } -async function expectEdited(container, exists) { +function expectEdited(container, exists) { + return waitFor(() => { + const indicator = domQuery(`${GROUP_SELECTOR} .bio-properties-panel-dot`, container); - await wait(50); - - const indicator = domQuery(`${GROUP_SELECTOR} .bio-properties-panel-dot`, container); - - if (exists) { - expect(indicator).to.exist; - } else { - expect(indicator).not.to.exist; - } + if (exists) { + expect(indicator).to.exist; + } else { + expect(indicator).not.to.exist; + } + }); } - -function wait(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); -} \ No newline at end of file diff --git a/test/spec/provider/zeebe/UserTaskImplementationProps.spec.js b/test/spec/provider/zeebe/UserTaskImplementationProps.spec.js index a8f9d617..101995b9 100644 --- a/test/spec/provider/zeebe/UserTaskImplementationProps.spec.js +++ b/test/spec/provider/zeebe/UserTaskImplementationProps.spec.js @@ -1,7 +1,8 @@ import TestContainer from 'mocha-test-container-support'; import { - act + act, + waitFor } from '@testing-library/preact'; import { @@ -242,19 +243,14 @@ function getZeebeUserTask(element) { } -async function expectEdited(container, exists) { +function expectEdited(container, exists) { + return waitFor(() => { + const indicator = domQuery(`${GROUP_SELECTOR} .bio-properties-panel-dot`, container); - await wait(50); - - const indicator = domQuery(`${GROUP_SELECTOR} .bio-properties-panel-dot`, container); - - if (exists) { - expect(indicator).to.exist; - } else { - expect(indicator).not.to.exist; - } + if (exists) { + expect(indicator).to.exist; + } else { + expect(indicator).not.to.exist; + } + }); } - -function wait(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); -} \ No newline at end of file