chore(boundary-event-behavior): clean up tests

This commit is contained in:
Philipp Fromme 2018-10-17 16:14:28 +02:00 committed by merge-me[bot]
parent 178e1cfccb
commit 6d54ff34e3
2 changed files with 40 additions and 31 deletions

View File

@ -13,7 +13,7 @@ import {
/** /**
* BPMN specific boundary event behavior * BPMN specific boundary event behavior
*/ */
export default function ConnectEventBasedGatewayBehavior(eventBus, modeling) { export default function BoundaryEventBehavior(eventBus, modeling) {
CommandInterceptor.call(this, eventBus); CommandInterceptor.call(this, eventBus);
@ -59,9 +59,9 @@ export default function ConnectEventBasedGatewayBehavior(eventBus, modeling) {
}); });
} }
ConnectEventBasedGatewayBehavior.$inject = [ BoundaryEventBehavior.$inject = [
'eventBus', 'eventBus',
'modeling' 'modeling'
]; ];
inherits(ConnectEventBasedGatewayBehavior, CommandInterceptor); inherits(BoundaryEventBehavior, CommandInterceptor);

View File

@ -16,7 +16,9 @@ describe('features/modeling/behavior - boundary event', function() {
beforeEach(bootstrapModeler(diagramXML, { modules: testModules })); beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
it('should remove the boundary event from the receive task after connecting the task with an event based gateway', describe('implicitly removing boundary events', function() {
it('after connecting to event-based gateway',
inject(function(modeling, elementRegistry) { inject(function(modeling, elementRegistry) {
// given // given
@ -30,26 +32,33 @@ describe('features/modeling/behavior - boundary event', function() {
}); });
// then // then
expect(elementRegistry.get(boundaryEvent.id)).to.be.undefined; expect(elementRegistry.get(boundaryEvent.id)).not.to.exist;
})); })
);
it('should remove Boundary from ReceiveTask after changing type of Gateway', inject(function(modeling, elementRegistry, bpmnReplace) {
it('after replacing connected gateway with event-based gateway',
inject(function(modeling, elementRegistry, bpmnReplace) {
// given // given
var gateway = elementRegistry.get('ExclusiveGateway_1'), var gateway = elementRegistry.get('ExclusiveGateway_1'),
receiveTask = elementRegistry.get('ReceiveTask_1'), receiveTask = elementRegistry.get('ReceiveTask_1'),
boundaryEvent = elementRegistry.get('BoundaryEvent_1'); boundaryEvent = elementRegistry.get('BoundaryEvent_1');
// when
modeling.connect(gateway, receiveTask, { modeling.connect(gateway, receiveTask, {
type: 'bpmn:SequenceFlow' type: 'bpmn:SequenceFlow'
}); });
// when
bpmnReplace.replaceElement(gateway, { bpmnReplace.replaceElement(gateway, {
type: 'bpmn:EventBasedGateway' type: 'bpmn:EventBasedGateway'
}); });
// then // then
expect(elementRegistry.get(boundaryEvent.id)).not.to.exist; expect(elementRegistry.get(boundaryEvent.id)).not.to.exist;
})); })
);
});
}); });