fix(popup-menu): the current event is hidden in the replace menu

Closes #322
This commit is contained in:
pedesen 2015-08-03 17:15:13 +02:00
parent 022bc9f192
commit 2c3c422e93
2 changed files with 56 additions and 1 deletions

View File

@ -260,7 +260,11 @@ function BpmnReplace(bpmnFactory, moddle, popupMenu, replace, selection, modelin
var target = entry.target;
var eventDefinition = businessObject.eventDefinitions && businessObject.eventDefinitions[0].$type,
cancelActivity;
if (businessObject.$type === 'bpmn:BoundaryEvent') {
cancelActivity = target.cancelActivity !== false;
}
var isEventDefinitionEqual = target.eventDefinition == eventDefinition,
isEventTypeEqual = businessObject.$type == target.type,

View File

@ -529,6 +529,57 @@ describe('features/popup-menu', function() {
beforeEach(bootstrapModeler(diagramXMLReplace, { modules: testModules }));
it('should contain all start events except the current one',
inject(function(popupMenu, bpmnReplace, elementRegistry) {
// given
var startEvent = elementRegistry.get('StartEvent_1');
// when
openPopup(startEvent);
var entriesContainer = queryPopup(popupMenu, '.djs-popup-body');
// then
expect(entriesContainer.childNodes.length).to.equal(6);
expect(queryEntry(popupMenu, 'replace-with-none-start')).to.be.null;
}));
it('should contain all intermediate events except the current one',
inject(function(popupMenu, bpmnReplace, elementRegistry) {
// given
var intermediateEvent = elementRegistry.get('IntermediateThrowEvent_1');
// when
openPopup(intermediateEvent);
var entriesContainer = queryPopup(popupMenu, '.djs-popup-body');
// then
expect(entriesContainer.childNodes.length).to.equal(12);
expect(queryEntry(popupMenu, 'replace-with-none-intermediate-throw')).to.be.null;
}));
it('should contain all end events except the current one',
inject(function(popupMenu, bpmnReplace, elementRegistry) {
// given
var endEvent = elementRegistry.get('EndEvent_1');
// when
openPopup(endEvent);
var entriesContainer = queryPopup(popupMenu, '.djs-popup-body');
// then
expect(entriesContainer.childNodes.length).to.equal(9);
expect(queryEntry(popupMenu, 'replace-with-none-end')).to.be.null;
}));
it('should contain all boundary events for an interrupting boundary event',
inject(function(popupMenu, bpmnReplace, elementRegistry) {