Skip to content

Commit

Permalink
fix: fix tests failing due to lazy instantiation of eventDefinitions
Browse files Browse the repository at this point in the history
* since the renderer now accesses `eventDefinitions` through the getter it's lazily instantiated and therefore not undefined; the tests should assume undefined in the first place
* remove unused `bpmnReplace` dependencies
  • Loading branch information
philippfromme committed Oct 25, 2023
1 parent 6efcd0e commit c741f7b
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 58 deletions.
20 changes: 10 additions & 10 deletions test/spec/features/modeling/behavior/ReplaceElementBehaviourSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ describe('features/modeling - replace element behavior', function() {

// then
expect(transaction.children).to.have.length(1);
expect(endEventAfter.businessObject.eventDefinitions).to.exist;
expect(endEventAfter.businessObject.get('eventDefinitions')).not.to.be.empty;
})
);

Expand All @@ -273,7 +273,7 @@ describe('features/modeling - replace element behavior', function() {

// then
expect(transaction.children).to.have.length(0);
expect(endEventAfter.businessObject.eventDefinitions).not.to.exist;
expect(endEventAfter.businessObject.get('eventDefinitions')).to.be.empty;
})
);

Expand Down Expand Up @@ -302,7 +302,7 @@ describe('features/modeling - replace element behavior', function() {

// then
expect(transaction.children).to.have.length(1);
expect(endEventAfter.businessObject.eventDefinitions).to.exist;
expect(endEventAfter.businessObject.get('eventDefinitions')).not.to.be.empty;
})
);

Expand Down Expand Up @@ -358,7 +358,7 @@ describe('features/modeling - replace element behavior', function() {
})[0];

// then
expect(afterBoundaryEvent.businessObject.eventDefinitions).exist;
expect(afterBoundaryEvent.businessObject.get('eventDefinitions')).not.to.be.empty;
expect(afterBoundaryEvent.businessObject.attachedToRef).to.equal(transaction.businessObject);
expect(transaction.attachers).to.have.length(1);
})
Expand Down Expand Up @@ -387,7 +387,7 @@ describe('features/modeling - replace element behavior', function() {
})[0];

// then
expect(movedBoundaryEvent.businessObject.eventDefinitions).not.to.exist;
expect(movedBoundaryEvent.businessObject.get('eventDefinitions')).to.be.empty;
expect(movedBoundaryEvent.businessObject.attachedToRef).to.equal(subProcess.businessObject);
expect(movedBoundaryEvent.parent).to.equal(process);

Expand Down Expand Up @@ -421,7 +421,7 @@ describe('features/modeling - replace element behavior', function() {
})[0];

// then
expect(movedBoundaryEvent.businessObject.eventDefinitions).to.exist;
expect(movedBoundaryEvent.businessObject.get('eventDefinitions')).not.to.be.empty;
expect(movedBoundaryEvent.businessObject.attachedToRef).to.equal(transaction.businessObject);

expect(movedBoundaryEvent.host).to.equal(transaction);
Expand Down Expand Up @@ -524,7 +524,7 @@ describe('features/modeling - replace element behavior', function() {
var createdEvent = elementRegistry.get(id);

expect(createdEvent).to.exist;
expect(createdEvent.businessObject.eventDefinitions).to.not.exist;
expect(createdEvent.businessObject.get('eventDefinitions')).to.be.empty;
})
);

Expand All @@ -546,9 +546,9 @@ describe('features/modeling - replace element behavior', function() {
var createdEvent = elementRegistry.get(id);

expect(createdEvent).to.eql(startEvent);
expect(createdEvent.businessObject.eventDefinitions).to.have.lengthOf(1);
expect(createdEvent.businessObject.get('eventDefinitions')).to.have.lengthOf(1);
expect(
is(createdEvent.businessObject.eventDefinitions[0], 'bpmn:TimerEventDefinition')
is(createdEvent.businessObject.get('eventDefinitions')[0], 'bpmn:TimerEventDefinition')
).to.be.true;
})
);
Expand All @@ -573,7 +573,7 @@ describe('features/modeling - replace element behavior', function() {
var createdEvent = elementRegistry.get(id);

expect(createdEvent).to.exist;
expect(createdEvent.businessObject.eventDefinitions).not.to.exist;
expect(createdEvent.businessObject.get('eventDefinitions')).to.be.empty;
expect(createdEvent.businessObject.get('isInterrupting')).to.be.true;
})
);
Expand Down
Loading

0 comments on commit c741f7b

Please sign in to comment.