diff --git a/test/spec/provider/bpmn/EscalationProps.spec.js b/test/spec/provider/bpmn/EscalationProps.spec.js index 845dd17b..ebc31cab 100644 --- a/test/spec/provider/bpmn/EscalationProps.spec.js +++ b/test/spec/provider/bpmn/EscalationProps.spec.js @@ -78,7 +78,7 @@ describe('provider/bpmn - EscalationProps', function() { elementRegistry.get('EscalationIntermediateEvent_1') ]; - escalationElements.forEach(async (element) => { + for (const element of escalationElements) { // when await act(() => { @@ -87,9 +87,14 @@ describe('provider/bpmn - EscalationProps', function() { // then const select = domQuery('select[name=escalationRef]', container); - expect(select.value).to.eql(getEscalation(element).get('id')); - }); + const escalation = getEscalation(element); + + expect(select).to.exist; + if (escalation) { + expect(select.value).to.eql(escalation.get('id')); + } + } })); diff --git a/test/spec/provider/bpmn/SignalProps.spec.js b/test/spec/provider/bpmn/SignalProps.spec.js index 4be9f67b..c8290580 100644 --- a/test/spec/provider/bpmn/SignalProps.spec.js +++ b/test/spec/provider/bpmn/SignalProps.spec.js @@ -67,7 +67,7 @@ describe('provider/bpmn - SignalProps', function() { elementRegistry.get('IntermediateThrowEvent_1') ]; - plainElements.forEach(async (ele) => { + for (const ele of plainElements) { // when await act(() => { @@ -77,7 +77,7 @@ describe('provider/bpmn - SignalProps', function() { // then const signalRefSelect = domQuery('select[name=signalRef]', container); expect(signalRefSelect).to.be.null; - }); + } }) ); @@ -94,7 +94,7 @@ describe('provider/bpmn - SignalProps', function() { elementRegistry.get('SignalCatchEvent_1') ]; - signalElements.forEach(async (ele) => { + for (const ele of signalElements) { // when await act(() => { @@ -104,7 +104,7 @@ describe('provider/bpmn - SignalProps', function() { // then const signalRefSelect = domQuery('select[name=signalRef]', container); expect(signalRefSelect.value).to.eql(getSignal(ele).get('id')); - }); + } })); @@ -290,7 +290,7 @@ describe('provider/bpmn - SignalProps', function() { elementRegistry.get('IntermediateThrowEvent_1') ]; - plainElements.forEach(async (ele) => { + for (const ele of plainElements) { // when await act(() => { @@ -301,7 +301,7 @@ describe('provider/bpmn - SignalProps', function() { const signalNameInput = domQuery('input[name=signalName]', container); expect(signalNameInput).to.be.null; - }); + } }) ); @@ -317,7 +317,7 @@ describe('provider/bpmn - SignalProps', function() { elementRegistry.get('SignalCatchEvent_1') ]; - signalElements.forEach(async (ele) => { + for (const ele of signalElements) { await act(() => { selection.select(ele); }); @@ -327,7 +327,7 @@ describe('provider/bpmn - SignalProps', function() { // then expect(signalNameInput.value).to.eql(getSignal(ele).get('name')); - }); + } })); diff --git a/test/spec/provider/zeebe/BusinessRuleImplementationProps.spec.js b/test/spec/provider/zeebe/BusinessRuleImplementationProps.spec.js index d43e58f8..afc1ebf0 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 { @@ -119,6 +120,8 @@ describe('provider/zeebe - BusinessRuleImplementationProps', function() { })); + // TODO(@barmac): this test is fails as false-positive when run locally on MacOS as part of the full test suite, + // cf. https://github.com/bpmn-io/bpmn-js-properties-panel/pull/1111#pullrequestreview-2635770727 it('should display dmn', inject(async function(elementRegistry, selection) { // given @@ -138,6 +141,8 @@ describe('provider/zeebe - BusinessRuleImplementationProps', function() { })); + // TODO(@barmac): this test is fails as false-positive when run locally on MacOS as part of the full test suite, + // cf. https://github.com/bpmn-io/bpmn-js-properties-panel/pull/1111#pullrequestreview-2635770727 it('should display jobWorker', inject(async function(elementRegistry, selection) { // given @@ -367,19 +372,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/ConditionProps.spec.js b/test/spec/provider/zeebe/ConditionProps.spec.js index 84df8e14..2756556e 100644 --- a/test/spec/provider/zeebe/ConditionProps.spec.js +++ b/test/spec/provider/zeebe/ConditionProps.spec.js @@ -61,9 +61,13 @@ describe('provider/zeebe - ConditionProps', function() { it('should display', inject(async function(elementRegistry, selection) { // given - const elements = [ 'Flow2', 'Flow3', 'Flow4' ]; + const elements = [ + 'Flow2', + 'Flow3', + 'Flow4' + ]; - elements.forEach(async ele => { + for (const ele of elements) { const sequenceFlow = elementRegistry.get(ele); // when @@ -71,11 +75,11 @@ describe('provider/zeebe - ConditionProps', function() { selection.select(sequenceFlow); }); - const conditionExpressionInput = domQuery('input[name=conditionExpression]', container); + const conditionExpressionInput = domQuery('[id=bio-properties-panel-conditionExpression]', container); // then expect(conditionExpressionInput).to.exist; - }); + } })); diff --git a/test/spec/provider/zeebe/ScriptImplementationProps.spec.js b/test/spec/provider/zeebe/ScriptImplementationProps.spec.js index 173219de..0ec10cab 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 { @@ -120,6 +121,8 @@ describe('provider/zeebe - ScriptImplementationProps', function() { })); + // TODO(@barmac): this test is fails as false-positive when run locally on MacOS as part of the full test suite, + // cf. https://github.com/bpmn-io/bpmn-js-properties-panel/pull/1111#pullrequestreview-2635770727 it('should display script', inject(async function(elementRegistry, selection) { // given @@ -139,6 +142,8 @@ describe('provider/zeebe - ScriptImplementationProps', function() { })); + // TODO(@barmac): this test is fails as false-positive when run locally on MacOS as part of the full test suite, + // cf. https://github.com/bpmn-io/bpmn-js-properties-panel/pull/1111#pullrequestreview-2635770727 it('should display jobWorker', inject(async function(elementRegistry, selection) { // given @@ -346,19 +351,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..c13d51ed 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 { @@ -100,6 +101,8 @@ describe('provider/zeebe - UserTaskImplementationProps', function() { })); + // TODO(@barmac): this test is fails as false-positive when run locally on MacOS as part of the full test suite, + // cf. https://github.com/bpmn-io/bpmn-js-properties-panel/pull/1111#pullrequestreview-2635770727 it('should display zeebe user task', inject(async function(elementRegistry, selection) { // given @@ -242,19 +245,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