chore(boundary-event-behavior): clean up tests
This commit is contained in:
parent
178e1cfccb
commit
6d54ff34e3
|
@ -13,7 +13,7 @@ import {
|
|||
/**
|
||||
* BPMN specific boundary event behavior
|
||||
*/
|
||||
export default function ConnectEventBasedGatewayBehavior(eventBus, modeling) {
|
||||
export default function BoundaryEventBehavior(eventBus, modeling) {
|
||||
|
||||
CommandInterceptor.call(this, eventBus);
|
||||
|
||||
|
@ -59,9 +59,9 @@ export default function ConnectEventBasedGatewayBehavior(eventBus, modeling) {
|
|||
});
|
||||
}
|
||||
|
||||
ConnectEventBasedGatewayBehavior.$inject = [
|
||||
BoundaryEventBehavior.$inject = [
|
||||
'eventBus',
|
||||
'modeling'
|
||||
];
|
||||
|
||||
inherits(ConnectEventBasedGatewayBehavior, CommandInterceptor);
|
||||
inherits(BoundaryEventBehavior, CommandInterceptor);
|
||||
|
|
|
@ -16,7 +16,9 @@ describe('features/modeling/behavior - boundary event', function() {
|
|||
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) {
|
||||
|
||||
// given
|
||||
|
@ -30,26 +32,33 @@ describe('features/modeling/behavior - boundary event', function() {
|
|||
});
|
||||
|
||||
// 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
|
||||
var gateway = elementRegistry.get('ExclusiveGateway_1'),
|
||||
receiveTask = elementRegistry.get('ReceiveTask_1'),
|
||||
boundaryEvent = elementRegistry.get('BoundaryEvent_1');
|
||||
|
||||
// when
|
||||
modeling.connect(gateway, receiveTask, {
|
||||
type: 'bpmn:SequenceFlow'
|
||||
});
|
||||
|
||||
// when
|
||||
bpmnReplace.replaceElement(gateway, {
|
||||
type: 'bpmn:EventBasedGateway'
|
||||
});
|
||||
|
||||
// then
|
||||
expect(elementRegistry.get(boundaryEvent.id)).not.to.exist;
|
||||
}));
|
||||
})
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
});
|
Loading…
Reference in New Issue