chore(tests): migrate to (.not).exist matcher
Migrate parts of our test suite that rely on legacy `.to.be.(un)defined` matchers to Chai's `.to(.not).exist`. Closes #423 Closes #422
This commit is contained in:
parent
9322a6a1e6
commit
e00197d67a
|
@ -107,8 +107,8 @@ describe('Modeler', function() {
|
||||||
elementRegistry = viewer.get('elementRegistry');
|
elementRegistry = viewer.get('elementRegistry');
|
||||||
|
|
||||||
// assume
|
// assume
|
||||||
expect(overlays).to.be.defined;
|
expect(overlays).to.exist;
|
||||||
expect(elementRegistry).to.be.defined;
|
expect(elementRegistry).to.exist;
|
||||||
|
|
||||||
|
|
||||||
// when
|
// when
|
||||||
|
@ -158,7 +158,7 @@ describe('Modeler', function() {
|
||||||
canvas = viewer.get('canvas');
|
canvas = viewer.get('canvas');
|
||||||
|
|
||||||
// assume
|
// assume
|
||||||
expect(bendpointMove).to.be.defined;
|
expect(bendpointMove).to.exist;
|
||||||
|
|
||||||
// when
|
// when
|
||||||
bendpointMove.start(createEvent(canvas, { x: 0, y: 0 }), elementRegistry.get('SequenceFlow_1'), 1);
|
bendpointMove.start(createEvent(canvas, { x: 0, y: 0 }), elementRegistry.get('SequenceFlow_1'), 1);
|
||||||
|
@ -180,7 +180,7 @@ describe('Modeler', function() {
|
||||||
|
|
||||||
modeler.importXML(xml, function(err) {
|
modeler.importXML(xml, function(err) {
|
||||||
|
|
||||||
expect(err).to.be.defined;
|
expect(err).to.exist;
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
|
@ -38,7 +38,7 @@ describe('NavigatedViewer', function() {
|
||||||
it('should include zoomScroll', function(done) {
|
it('should include zoomScroll', function(done) {
|
||||||
|
|
||||||
createViewer(xml, function(err, warnings, viewer) {
|
createViewer(xml, function(err, warnings, viewer) {
|
||||||
expect(viewer.get('zoomScroll')).to.be.defined;
|
expect(viewer.get('zoomScroll')).to.exist;
|
||||||
|
|
||||||
done(err);
|
done(err);
|
||||||
});
|
});
|
||||||
|
@ -47,7 +47,7 @@ describe('NavigatedViewer', function() {
|
||||||
|
|
||||||
it('should include moveCanvas', function(done) {
|
it('should include moveCanvas', function(done) {
|
||||||
createViewer(xml, function(err, warnings, viewer) {
|
createViewer(xml, function(err, warnings, viewer) {
|
||||||
expect(viewer.get('moveCanvas')).to.be.defined;
|
expect(viewer.get('moveCanvas')).to.exist;
|
||||||
|
|
||||||
done(err);
|
done(err);
|
||||||
});
|
});
|
||||||
|
|
|
@ -162,8 +162,8 @@ describe('Viewer', function() {
|
||||||
elementRegistry = viewer.get('elementRegistry');
|
elementRegistry = viewer.get('elementRegistry');
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(overlays).to.be.defined;
|
expect(overlays).to.exist;
|
||||||
expect(elementRegistry).to.be.defined;
|
expect(elementRegistry).to.exist;
|
||||||
|
|
||||||
// when
|
// when
|
||||||
overlays.add('SubProcess_1', {
|
overlays.add('SubProcess_1', {
|
||||||
|
@ -190,7 +190,7 @@ describe('Viewer', function() {
|
||||||
|
|
||||||
function expectMessage(e, expectedMessage) {
|
function expectMessage(e, expectedMessage) {
|
||||||
|
|
||||||
expect(e).to.be.defined;
|
expect(e).to.exist;
|
||||||
|
|
||||||
if (expectedMessage instanceof RegExp) {
|
if (expectedMessage instanceof RegExp) {
|
||||||
expect(e.message).to.match(expectedMessage);
|
expect(e.message).to.match(expectedMessage);
|
||||||
|
@ -420,7 +420,7 @@ describe('Viewer', function() {
|
||||||
appendTestRect(svgDoc);
|
appendTestRect(svgDoc);
|
||||||
appendTestRect(svgDoc);
|
appendTestRect(svgDoc);
|
||||||
|
|
||||||
expect(svgDoc.querySelectorAll('.outer-bound-marker')).to.be.defined;
|
expect(svgDoc.querySelectorAll('.outer-bound-marker')).to.exist;
|
||||||
|
|
||||||
// when
|
// when
|
||||||
viewer.saveSVG(function(err, svg) {
|
viewer.saveSVG(function(err, svg) {
|
||||||
|
@ -534,7 +534,7 @@ describe('Viewer', function() {
|
||||||
sendTask = taskShape.businessObject;
|
sendTask = taskShape.businessObject;
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(sendTask).to.be.defined;
|
expect(sendTask).to.exist;
|
||||||
|
|
||||||
var extensionElements = sendTask.extensionElements;
|
var extensionElements = sendTask.extensionElements;
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ describe('environment - mocking', function() {
|
||||||
|
|
||||||
it('should inject bpmnjs', inject(function(bpmnjs) {
|
it('should inject bpmnjs', inject(function(bpmnjs) {
|
||||||
|
|
||||||
expect(bpmnjs).to.be.defined;
|
expect(bpmnjs).to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -238,7 +238,7 @@ describe('features/auto-resize', function() {
|
||||||
|
|
||||||
expect(participant).to.have.bounds(expectedBounds);
|
expect(participant).to.have.bounds(expectedBounds);
|
||||||
|
|
||||||
expect(task2).to.be.defined;
|
expect(task2).to.exist;
|
||||||
expect(task.outgoing).not.to.be.empty;
|
expect(task.outgoing).not.to.be.empty;
|
||||||
expect(task2.incoming).not.to.be.empty;
|
expect(task2.incoming).not.to.be.empty;
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -33,7 +33,7 @@ describe('features/modeling - append shape', function() {
|
||||||
target = targetShape.businessObject;
|
target = targetShape.businessObject;
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(targetShape).to.be.defined;
|
expect(targetShape).to.exist;
|
||||||
expect(target.$instanceOf('bpmn:Task')).to.be.true;
|
expect(target.$instanceOf('bpmn:Task')).to.be.true;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ describe('features/modeling - append shape', function() {
|
||||||
target = targetShape.businessObject;
|
target = targetShape.businessObject;
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(target.di).to.be.defined;
|
expect(target.di).to.exist;
|
||||||
expect(target.di.$parent).to.eql(startEvent.di.$parent);
|
expect(target.di.$parent).to.eql(startEvent.di.$parent);
|
||||||
|
|
||||||
expect(target.di).to.have.bounds(targetShape);
|
expect(target.di).to.have.bounds(targetShape);
|
||||||
|
@ -87,8 +87,8 @@ describe('features/modeling - append shape', function() {
|
||||||
var label = targetShape.label;
|
var label = targetShape.label;
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(label).to.be.defined;
|
expect(label).to.exist;
|
||||||
expect(elementRegistry.get(label.id)).to.be.defined;
|
expect(elementRegistry.get(label.id)).to.exist;
|
||||||
|
|
||||||
expect(label).to.have.bounds(assign({ x: 441, y: 278 }, LabelUtil.DEFAULT_LABEL_SIZE));
|
expect(label).to.have.bounds(assign({ x: 441, y: 278 }, LabelUtil.DEFAULT_LABEL_SIZE));
|
||||||
}));
|
}));
|
||||||
|
@ -104,7 +104,7 @@ describe('features/modeling - append shape', function() {
|
||||||
target = targetShape.businessObject;
|
target = targetShape.businessObject;
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(target.di.label).to.be.defined;
|
expect(target.di.label).to.exist;
|
||||||
|
|
||||||
expect(target.di.label).to.have.bounds(targetShape.label);
|
expect(target.di.label).to.have.bounds(targetShape.label);
|
||||||
}));
|
}));
|
||||||
|
@ -130,7 +130,7 @@ describe('features/modeling - append shape', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(connection).to.be.defined;
|
expect(connection).to.exist;
|
||||||
expect(connection.$instanceOf('bpmn:SequenceFlow')).to.be.true;
|
expect(connection.$instanceOf('bpmn:SequenceFlow')).to.be.true;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -184,8 +184,8 @@ describe('features/modeling - append shape', function() {
|
||||||
expect(connection.$parent).to.be.null;
|
expect(connection.$parent).to.be.null;
|
||||||
expect(subProcess.di.$parent.get('planeElement')).not.to.include(connection.di);
|
expect(subProcess.di.$parent.get('planeElement')).not.to.include(connection.di);
|
||||||
|
|
||||||
expect(targetShape.label).not.to.be.defined;
|
expect(targetShape.label).not.to.exist;
|
||||||
expect(elementRegistry.get(target.id + '_label')).not.to.be.defined;
|
expect(elementRegistry.get(target.id + '_label')).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ describe('features/modeling - append shape', function() {
|
||||||
expect(connection.$parent).to.be.null;
|
expect(connection.$parent).to.be.null;
|
||||||
expect(subProcess.di.$parent.get('planeElement')).not.to.include(connection.di);
|
expect(subProcess.di.$parent.get('planeElement')).not.to.include(connection.di);
|
||||||
|
|
||||||
expect(elementRegistry.get(targetShape.id)).not.to.be.defined;
|
expect(elementRegistry.get(targetShape.id)).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ describe('features/modeling - append shape', function() {
|
||||||
expect(connection.$parent).to.be.null;
|
expect(connection.$parent).to.be.null;
|
||||||
expect(subProcess.di.$parent.get('planeElement')).not.to.include(connection.di);
|
expect(subProcess.di.$parent.get('planeElement')).not.to.include(connection.di);
|
||||||
|
|
||||||
expect(elementRegistry.get(connection.id + '_label')).not.to.be.defined;
|
expect(elementRegistry.get(connection.id + '_label')).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ describe('features/modeling - append shape', function() {
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(targetShape2.parent).to.be.null;
|
expect(targetShape2.parent).to.be.null;
|
||||||
expect(elementRegistry.get(targetShape2.id)).not.to.be.defined;
|
expect(elementRegistry.get(targetShape2.id)).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ describe('features/modeling - append shape', function() {
|
||||||
target = targetShape.businessObject;
|
target = targetShape.businessObject;
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(targetShape).to.be.defined;
|
expect(targetShape).to.exist;
|
||||||
expect(target.$instanceOf('bpmn:ExclusiveGateway')).to.be.true;
|
expect(target.$instanceOf('bpmn:ExclusiveGateway')).to.be.true;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ describe('features/bendpoints', function() {
|
||||||
|
|
||||||
|
|
||||||
it('should contain bendpoints', inject(function(bendpoints) {
|
it('should contain bendpoints', inject(function(bendpoints) {
|
||||||
expect(bendpoints).to.be.defined;
|
expect(bendpoints).to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
});
|
});
|
|
@ -23,7 +23,7 @@ describe('features - bpmn-factory', function() {
|
||||||
it('should return instance', inject(function(bpmnFactory) {
|
it('should return instance', inject(function(bpmnFactory) {
|
||||||
|
|
||||||
var task = bpmnFactory.create('bpmn:Task');
|
var task = bpmnFactory.create('bpmn:Task');
|
||||||
expect(task).to.be.defined;
|
expect(task).to.exist;
|
||||||
expect(task.$type).to.equal('bpmn:Task');
|
expect(task.$type).to.equal('bpmn:Task');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,8 @@ describe('features/modeling - create connection', function() {
|
||||||
var sequenceFlow = sequenceFlowConnection.businessObject;
|
var sequenceFlow = sequenceFlowConnection.businessObject;
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(sequenceFlowConnection).to.be.defined;
|
expect(sequenceFlowConnection).to.exist;
|
||||||
expect(sequenceFlow).to.be.defined;
|
expect(sequenceFlow).to.exist;
|
||||||
|
|
||||||
expect(sequenceFlow.sourceRef).to.eql(task);
|
expect(sequenceFlow.sourceRef).to.eql(task);
|
||||||
expect(sequenceFlow.targetRef).to.eql(gateway);
|
expect(sequenceFlow.targetRef).to.eql(gateway);
|
||||||
|
|
|
@ -63,7 +63,7 @@ describe('features/modeling - update properties', function() {
|
||||||
modeling.updateProperties(gatewayShape, { 'default': undefined });
|
modeling.updateProperties(gatewayShape, { 'default': undefined });
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(gatewayShape.businessObject['default']).not.to.be.defined;
|
expect(gatewayShape.businessObject['default']).not.to.exist;
|
||||||
|
|
||||||
// flow got updated, too
|
// flow got updated, too
|
||||||
expect(updatedElements).to.include(elementRegistry.get('SequenceFlow_1'));
|
expect(updatedElements).to.include(elementRegistry.get('SequenceFlow_1'));
|
||||||
|
@ -111,7 +111,7 @@ describe('features/modeling - update properties', function() {
|
||||||
modeling.updateProperties(flowConnection, { name: undefined });
|
modeling.updateProperties(flowConnection, { name: undefined });
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(flowConnection.businessObject.name).not.to.be.defined;
|
expect(flowConnection.businessObject.name).not.to.exist;
|
||||||
|
|
||||||
// flow label is now hidden
|
// flow label is now hidden
|
||||||
expect(flowConnection.label.hidden).to.be.true;
|
expect(flowConnection.label.hidden).to.be.true;
|
||||||
|
@ -169,7 +169,7 @@ describe('features/modeling - update properties', function() {
|
||||||
commandStack.undo();
|
commandStack.undo();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(taskShape.businessObject.loopCharactersistics).not.to.be.defined;
|
expect(taskShape.businessObject.loopCharactersistics).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ describe('features/modeling - update properties', function() {
|
||||||
commandStack.undo();
|
commandStack.undo();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(gatewayShape.businessObject['default']).to.be.defined;
|
expect(gatewayShape.businessObject['default']).to.exist;
|
||||||
|
|
||||||
// flow got updated, too
|
// flow got updated, too
|
||||||
expect(updatedElements).to.include(elementRegistry.get('SequenceFlow_1'));
|
expect(updatedElements).to.include(elementRegistry.get('SequenceFlow_1'));
|
||||||
|
@ -255,8 +255,8 @@ describe('features/modeling - update properties', function() {
|
||||||
commandStack.undo();
|
commandStack.undo();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(flowConnection.businessObject.get('xmlns:foo')).to.be.undefined;
|
expect(flowConnection.businessObject.get('xmlns:foo')).not.to.exist;
|
||||||
expect(flowConnection.businessObject.get('foo:customAttr')).to.be.undefined;
|
expect(flowConnection.businessObject.get('foo:customAttr')).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -292,7 +292,7 @@ describe('features/modeling - update properties', function() {
|
||||||
commandStack.redo();
|
commandStack.redo();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(gatewayShape.businessObject['default']).not.to.be.defined;
|
expect(gatewayShape.businessObject['default']).not.to.exist;
|
||||||
|
|
||||||
// flow got updated, too
|
// flow got updated, too
|
||||||
expect(updatedElements).to.include(elementRegistry.get('SequenceFlow_1'));
|
expect(updatedElements).to.include(elementRegistry.get('SequenceFlow_1'));
|
||||||
|
@ -329,7 +329,7 @@ describe('features/modeling - update properties', function() {
|
||||||
commandStack.redo();
|
commandStack.redo();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(flowConnection.businessObject.name).not.to.be.defined;
|
expect(flowConnection.businessObject.name).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -41,7 +41,7 @@ describe('features/modeling - append text-annotation', function() {
|
||||||
var connecting = connectingConnection.businessObject;
|
var connecting = connectingConnection.businessObject;
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(annotationShape).to.be.defined;
|
expect(annotationShape).to.exist;
|
||||||
expect(annotation.$instanceOf('bpmn:TextAnnotation')).to.be.true;
|
expect(annotation.$instanceOf('bpmn:TextAnnotation')).to.be.true;
|
||||||
|
|
||||||
expect(connecting.$instanceOf('bpmn:Association')).to.be.true;
|
expect(connecting.$instanceOf('bpmn:Association')).to.be.true;
|
||||||
|
@ -73,7 +73,7 @@ describe('features/modeling - append text-annotation', function() {
|
||||||
var connecting = connectingConnection.businessObject;
|
var connecting = connectingConnection.businessObject;
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(annotationShape).to.be.defined;
|
expect(annotationShape).to.exist;
|
||||||
expect(annotation.$instanceOf('bpmn:TextAnnotation')).to.be.true;
|
expect(annotation.$instanceOf('bpmn:TextAnnotation')).to.be.true;
|
||||||
|
|
||||||
expect(connecting.$instanceOf('bpmn:Association')).to.be.true;
|
expect(connecting.$instanceOf('bpmn:Association')).to.be.true;
|
||||||
|
|
|
@ -23,7 +23,7 @@ function expectConnected(source, target, connectionOrType) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function expectNotConnected(source, target, connectionOrType) {
|
function expectNotConnected(source, target, connectionOrType) {
|
||||||
expect(getConnection(source, target, connectionOrType)).not.to.be.defined;
|
expect(getConnection(source, target, connectionOrType)).not.to.exist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ describe('features/popup-menu', function() {
|
||||||
openPopup(task);
|
openPopup(task);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(loopCharacteristics.isSequential).to.be.undefined;
|
expect(loopCharacteristics.isSequential).not.to.exist;
|
||||||
expect(popupMenu._getEntry('toggle-loop').active).to.be.true;
|
expect(popupMenu._getEntry('toggle-loop').active).to.be.true;
|
||||||
expect(is(loopCharacteristics, 'bpmn:MultiInstanceLoopCharacteristics')).to.be.false;
|
expect(is(loopCharacteristics, 'bpmn:MultiInstanceLoopCharacteristics')).to.be.false;
|
||||||
}));
|
}));
|
||||||
|
@ -192,7 +192,7 @@ describe('features/popup-menu', function() {
|
||||||
var parallelEntry = queryEntry(popupMenu, 'toggle-parallel-mi');
|
var parallelEntry = queryEntry(popupMenu, 'toggle-parallel-mi');
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(task.businessObject.loopCharacteristics).to.be.undefined;
|
expect(task.businessObject.loopCharacteristics).not.to.exist;
|
||||||
expect(domClasses(parallelEntry).has('active')).to.be.false;
|
expect(domClasses(parallelEntry).has('active')).to.be.false;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -282,7 +282,7 @@ describe('features/popup-menu', function() {
|
||||||
var sequentialEntry = queryEntry(popupMenu, 'toggle-sequential-mi');
|
var sequentialEntry = queryEntry(popupMenu, 'toggle-sequential-mi');
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(task.businessObject.loopCharacteristics).to.be.undefined;
|
expect(task.businessObject.loopCharacteristics).not.to.exist;
|
||||||
expect(domClasses(sequentialEntry).has('active')).to.be.false;
|
expect(domClasses(sequentialEntry).has('active')).to.be.false;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -373,7 +373,7 @@ describe('features/popup-menu', function() {
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(domClasses(loopEntry).has('active')).to.be.false;
|
expect(domClasses(loopEntry).has('active')).to.be.false;
|
||||||
expect(is(task.businessObject.loopCharacteristics, 'bpmn:MultiInstanceLoopCharacteristics')).to.be.undefined;
|
expect(is(task.businessObject.loopCharacteristics, 'bpmn:MultiInstanceLoopCharacteristics')).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
@ -461,7 +461,7 @@ describe('features/popup-menu', function() {
|
||||||
var sendTask = popupMenu.trigger(globalEvent(entry, { x: 0, y: 0 }));
|
var sendTask = popupMenu.trigger(globalEvent(entry, { x: 0, y: 0 }));
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(sendTask.businessObject.loopCharacteristics).to.be.defined;
|
expect(sendTask.businessObject.loopCharacteristics).to.exist;
|
||||||
expect(sendTask.businessObject.loopCharacteristics.isSequential).to.be.true;
|
expect(sendTask.businessObject.loopCharacteristics.isSequential).to.be.true;
|
||||||
expect(is(sendTask.businessObject.loopCharacteristics, 'bpmn:MultiInstanceLoopCharacteristics')).to.be.true;
|
expect(is(sendTask.businessObject.loopCharacteristics, 'bpmn:MultiInstanceLoopCharacteristics')).to.be.true;
|
||||||
}));
|
}));
|
||||||
|
@ -482,7 +482,7 @@ describe('features/popup-menu', function() {
|
||||||
var callActivity = popupMenu.trigger(globalEvent(entry, { x: 0, y: 0 }));
|
var callActivity = popupMenu.trigger(globalEvent(entry, { x: 0, y: 0 }));
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(callActivity.businessObject.loopCharacteristics).to.be.defined;
|
expect(callActivity.businessObject.loopCharacteristics).to.exist;
|
||||||
expect(callActivity.businessObject.loopCharacteristics.isSequential).to.be.true;
|
expect(callActivity.businessObject.loopCharacteristics.isSequential).to.be.true;
|
||||||
expect(is(callActivity.businessObject.loopCharacteristics, 'bpmn:MultiInstanceLoopCharacteristics')).to.be.true;
|
expect(is(callActivity.businessObject.loopCharacteristics, 'bpmn:MultiInstanceLoopCharacteristics')).to.be.true;
|
||||||
}));
|
}));
|
||||||
|
@ -635,7 +635,7 @@ describe('features/popup-menu', function() {
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(queryEntry(popupMenu, 'replace-with-non-interrupting-message-start')).to.be.null;
|
expect(queryEntry(popupMenu, 'replace-with-non-interrupting-message-start')).to.be.null;
|
||||||
expect(queryEntry(popupMenu, 'replace-with-message-start')).to.be.defined;
|
expect(queryEntry(popupMenu, 'replace-with-message-start')).to.exist;
|
||||||
expect(entriesContainer.childNodes.length).to.equal(11);
|
expect(entriesContainer.childNodes.length).to.equal(11);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -658,7 +658,7 @@ describe('features/popup-menu', function() {
|
||||||
var entriesContainer = queryPopup(popupMenu, '.djs-popup-body');
|
var entriesContainer = queryPopup(popupMenu, '.djs-popup-body');
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(queryEntry(popupMenu, 'replace-with-conditional-start')).to.be.defined;
|
expect(queryEntry(popupMenu, 'replace-with-conditional-start')).to.exist;
|
||||||
expect(queryEntry(popupMenu, 'replace-with-non-interrupting-conditional-start')).to.be.null;
|
expect(queryEntry(popupMenu, 'replace-with-non-interrupting-conditional-start')).to.be.null;
|
||||||
expect(entriesContainer.childNodes.length).to.equal(11);
|
expect(entriesContainer.childNodes.length).to.equal(11);
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -40,7 +40,7 @@ describe('features/replace', function() {
|
||||||
// then
|
// then
|
||||||
var businessObject = newElement.businessObject;
|
var businessObject = newElement.businessObject;
|
||||||
|
|
||||||
expect(newElement).to.be.defined;
|
expect(newElement).to.exist;
|
||||||
expect(is(businessObject, 'bpmn:UserTask')).to.be.true;
|
expect(is(businessObject, 'bpmn:UserTask')).to.be.true;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ describe('features/replace', function() {
|
||||||
// then
|
// then
|
||||||
var businessObject = newElement.businessObject;
|
var businessObject = newElement.businessObject;
|
||||||
|
|
||||||
expect(newElement).to.be.defined;
|
expect(newElement).to.exist;
|
||||||
expect(is(businessObject, 'bpmn:InclusiveGateway')).to.be.true;
|
expect(is(businessObject, 'bpmn:InclusiveGateway')).to.be.true;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ describe('features/replace', function() {
|
||||||
var newElement = bpmnReplace.replaceElement(subProcess, newElementData);
|
var newElement = bpmnReplace.replaceElement(subProcess, newElementData);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(newElement).to.be.defined;
|
expect(newElement).to.exist;
|
||||||
expect(is(newElement.businessObject, 'bpmn:Transaction')).to.be.true;
|
expect(is(newElement.businessObject, 'bpmn:Transaction')).to.be.true;
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
@ -97,7 +97,7 @@ describe('features/replace', function() {
|
||||||
var newElement = bpmnReplace.replaceElement(transaction, newElementData);
|
var newElement = bpmnReplace.replaceElement(transaction, newElementData);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(newElement).to.be.defined;
|
expect(newElement).to.exist;
|
||||||
expect(is(newElement.businessObject, 'bpmn:SubProcess')).to.be.true;
|
expect(is(newElement.businessObject, 'bpmn:SubProcess')).to.be.true;
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
@ -116,7 +116,7 @@ describe('features/replace', function() {
|
||||||
var newElement = bpmnReplace.replaceElement(transaction, newElementData);
|
var newElement = bpmnReplace.replaceElement(transaction, newElementData);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(newElement).to.be.defined;
|
expect(newElement).to.exist;
|
||||||
expect(isEventSubProcess(newElement)).to.be.true;
|
expect(isEventSubProcess(newElement)).to.be.true;
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
@ -136,7 +136,7 @@ describe('features/replace', function() {
|
||||||
var newElement = bpmnReplace.replaceElement(boundaryEvent, newElementData);
|
var newElement = bpmnReplace.replaceElement(boundaryEvent, newElementData);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(newElement).to.be.defined;
|
expect(newElement).to.exist;
|
||||||
expect(is(newElement.businessObject, 'bpmn:BoundaryEvent')).to.be.true;
|
expect(is(newElement.businessObject, 'bpmn:BoundaryEvent')).to.be.true;
|
||||||
expect(newElement.businessObject.eventDefinitions[0].$type).to.equal('bpmn:EscalationEventDefinition');
|
expect(newElement.businessObject.eventDefinitions[0].$type).to.equal('bpmn:EscalationEventDefinition');
|
||||||
expect(newElement.businessObject.cancelActivity).to.be.true;
|
expect(newElement.businessObject.cancelActivity).to.be.true;
|
||||||
|
@ -158,7 +158,7 @@ describe('features/replace', function() {
|
||||||
var newElement = bpmnReplace.replaceElement(boundaryEvent, newElementData);
|
var newElement = bpmnReplace.replaceElement(boundaryEvent, newElementData);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(newElement).to.be.defined;
|
expect(newElement).to.exist;
|
||||||
expect(is(newElement.businessObject, 'bpmn:BoundaryEvent')).to.be.true;
|
expect(is(newElement.businessObject, 'bpmn:BoundaryEvent')).to.be.true;
|
||||||
expect(newElement.businessObject.eventDefinitions[0].$type).to.equal('bpmn:SignalEventDefinition');
|
expect(newElement.businessObject.eventDefinitions[0].$type).to.equal('bpmn:SignalEventDefinition');
|
||||||
expect(newElement.businessObject.cancelActivity).to.be.false;
|
expect(newElement.businessObject.cancelActivity).to.be.false;
|
||||||
|
@ -180,7 +180,7 @@ describe('features/replace', function() {
|
||||||
var newElement = bpmnReplace.replaceElement(boundaryEvent, newElementData);
|
var newElement = bpmnReplace.replaceElement(boundaryEvent, newElementData);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(newElement.host).to.be.defined;
|
expect(newElement.host).to.exist;
|
||||||
expect(newElement.host).to.eql(host);
|
expect(newElement.host).to.eql(host);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -290,7 +290,7 @@ describe('features/replace', function() {
|
||||||
var target = elementRegistry.get('Task_1'),
|
var target = elementRegistry.get('Task_1'),
|
||||||
businessObject = target.businessObject;
|
businessObject = target.businessObject;
|
||||||
|
|
||||||
expect(target).to.be.defined;
|
expect(target).to.exist;
|
||||||
expect(is(businessObject, 'bpmn:Task')).to.be.true;
|
expect(is(businessObject, 'bpmn:Task')).to.be.true;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -320,7 +320,7 @@ describe('features/replace', function() {
|
||||||
// then
|
// then
|
||||||
var businessObject = servicetask.businessObject;
|
var businessObject = servicetask.businessObject;
|
||||||
|
|
||||||
expect(servicetask).to.be.defined;
|
expect(servicetask).to.exist;
|
||||||
expect(is(businessObject, 'bpmn:ServiceTask')).to.be.true;
|
expect(is(businessObject, 'bpmn:ServiceTask')).to.be.true;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -353,8 +353,8 @@ describe('features/replace', function() {
|
||||||
target = outgoing.target;
|
target = outgoing.target;
|
||||||
|
|
||||||
|
|
||||||
expect(incoming).to.be.defined;
|
expect(incoming).to.exist;
|
||||||
expect(outgoing).to.be.defined;
|
expect(outgoing).to.exist;
|
||||||
expect(source).to.eql(elementRegistry.get('StartEvent_1'));
|
expect(source).to.eql(elementRegistry.get('StartEvent_1'));
|
||||||
expect(target).to.eql(elementRegistry.get('ExclusiveGateway_1'));
|
expect(target).to.eql(elementRegistry.get('ExclusiveGateway_1'));
|
||||||
}));
|
}));
|
||||||
|
@ -377,8 +377,8 @@ describe('features/replace', function() {
|
||||||
outgoing = newElement.outgoing[0];
|
outgoing = newElement.outgoing[0];
|
||||||
|
|
||||||
|
|
||||||
expect(incoming).to.be.undefined;
|
expect(incoming).not.to.exist;
|
||||||
expect(outgoing).to.be.undefined;
|
expect(outgoing).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
@ -399,8 +399,8 @@ describe('features/replace', function() {
|
||||||
outgoing = newElement.outgoing[0];
|
outgoing = newElement.outgoing[0];
|
||||||
|
|
||||||
|
|
||||||
expect(incoming).to.be.undefined;
|
expect(incoming).not.to.exist;
|
||||||
expect(outgoing).to.be.undefined;
|
expect(outgoing).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
@ -428,8 +428,8 @@ describe('features/replace', function() {
|
||||||
target = outgoing.target;
|
target = outgoing.target;
|
||||||
|
|
||||||
|
|
||||||
expect(incoming).to.be.defined;
|
expect(incoming).to.exist;
|
||||||
expect(outgoing).to.be.defined;
|
expect(outgoing).to.exist;
|
||||||
expect(source).to.eql(elementRegistry.get('StartEvent_1'));
|
expect(source).to.eql(elementRegistry.get('StartEvent_1'));
|
||||||
expect(target).to.eql(elementRegistry.get('ExclusiveGateway_1'));
|
expect(target).to.eql(elementRegistry.get('ExclusiveGateway_1'));
|
||||||
}));
|
}));
|
||||||
|
@ -456,8 +456,8 @@ describe('features/replace', function() {
|
||||||
target = outgoing.target;
|
target = outgoing.target;
|
||||||
|
|
||||||
|
|
||||||
expect(incoming).to.be.undefined;
|
expect(incoming).not.to.exist;
|
||||||
expect(outgoing).to.be.defined;
|
expect(outgoing).to.exist;
|
||||||
expect(target).to.eql(elementRegistry.get('Task_1'));
|
expect(target).to.eql(elementRegistry.get('Task_1'));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -483,8 +483,8 @@ describe('features/replace', function() {
|
||||||
source = incoming.source;
|
source = incoming.source;
|
||||||
|
|
||||||
|
|
||||||
expect(incoming).to.be.defined;
|
expect(incoming).to.exist;
|
||||||
expect(outgoing).to.be.undefined;
|
expect(outgoing).not.to.exist;
|
||||||
expect(source).to.eql(elementRegistry.get('Transaction_1'));
|
expect(source).to.eql(elementRegistry.get('Transaction_1'));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -514,8 +514,8 @@ describe('features/replace', function() {
|
||||||
target = outgoing.target;
|
target = outgoing.target;
|
||||||
|
|
||||||
|
|
||||||
expect(incoming).to.be.defined;
|
expect(incoming).to.exist;
|
||||||
expect(outgoing).to.be.defined;
|
expect(outgoing).to.exist;
|
||||||
expect(source).to.eql(elementRegistry.get('StartEvent_1'));
|
expect(source).to.eql(elementRegistry.get('StartEvent_1'));
|
||||||
expect(target).to.eql(elementRegistry.get('ExclusiveGateway_1'));
|
expect(target).to.eql(elementRegistry.get('ExclusiveGateway_1'));
|
||||||
}));
|
}));
|
||||||
|
@ -540,8 +540,8 @@ describe('features/replace', function() {
|
||||||
outgoing = newElement.outgoing[0];
|
outgoing = newElement.outgoing[0];
|
||||||
|
|
||||||
|
|
||||||
expect(incoming).to.be.undefined;
|
expect(incoming).not.to.exist;
|
||||||
expect(outgoing).to.be.undefined;
|
expect(outgoing).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
@ -564,8 +564,8 @@ describe('features/replace', function() {
|
||||||
outgoing = newElement.outgoing[0];
|
outgoing = newElement.outgoing[0];
|
||||||
|
|
||||||
|
|
||||||
expect(incoming).to.be.undefined;
|
expect(incoming).not.to.exist;
|
||||||
expect(outgoing).to.be.undefined;
|
expect(outgoing).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -721,8 +721,8 @@ describe('features/replace', function() {
|
||||||
var incoming = newElement.incoming[0],
|
var incoming = newElement.incoming[0],
|
||||||
outgoing = newElement.outgoing[0];
|
outgoing = newElement.outgoing[0];
|
||||||
|
|
||||||
expect(incoming).to.be.undefined;
|
expect(incoming).not.to.exist;
|
||||||
expect(outgoing).to.be.undefined;
|
expect(outgoing).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ describe('features/replace - chooser', function() {
|
||||||
bpmnReplace.openChooser({ x: 100, y: 100 }, element);
|
bpmnReplace.openChooser({ x: 100, y: 100 }, element);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(null).to.be.defined;
|
expect(null).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ describe('features/replace - chooser', function() {
|
||||||
bpmnReplace.openChooser({ x: 100, y: 100 }, element);
|
bpmnReplace.openChooser({ x: 100, y: 100 }, element);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(null).to.be.defined;
|
expect(null).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ describe('features/replace - chooser', function() {
|
||||||
bpmnReplace.openChooser({ x: 100, y: 100 }, element);
|
bpmnReplace.openChooser({ x: 100, y: 100 }, element);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(null).to.be.defined;
|
expect(null).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -34,9 +34,9 @@ describe('features/replace', function() {
|
||||||
bpmnReplace.replaceElement(element, target);
|
bpmnReplace.replaceElement(element, target);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(elementRegistry.get('Association_0gzxvep')).to.be.defined;
|
expect(elementRegistry.get('Association_0gzxvep')).to.exist;
|
||||||
expect(elementRegistry.get('SequenceFlow_1rme11l')).to.be.defined;
|
expect(elementRegistry.get('SequenceFlow_1rme11l')).to.exist;
|
||||||
expect(elementRegistry.get('SequenceFlow_0608fzs')).not.to.be.defined;
|
expect(elementRegistry.get('SequenceFlow_0608fzs')).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,8 +52,8 @@ describe('features/replace', function() {
|
||||||
bpmnReplace.replaceElement(element, target);
|
bpmnReplace.replaceElement(element, target);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(elementRegistry.get('Association_1ncsghq')).to.be.defined;
|
expect(elementRegistry.get('Association_1ncsghq')).to.exist;
|
||||||
expect(elementRegistry.get('SequenceFlow_0fn1a6r')).not.to.be.defined;
|
expect(elementRegistry.get('SequenceFlow_0fn1a6r')).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,8 +69,8 @@ describe('features/replace', function() {
|
||||||
bpmnReplace.replaceElement(element, target);
|
bpmnReplace.replaceElement(element, target);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(elementRegistry.get('Association_06tpzma')).to.be.defined;
|
expect(elementRegistry.get('Association_06tpzma')).to.exist;
|
||||||
expect(elementRegistry.get('SequenceFlow_19u6x8u')).not.to.be.defined;
|
expect(elementRegistry.get('SequenceFlow_19u6x8u')).not.to.exist;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -354,8 +354,8 @@ describe('import - Importer', function() {
|
||||||
// then
|
// then
|
||||||
expect(warnings.length).to.equal(0);
|
expect(warnings.length).to.equal(0);
|
||||||
|
|
||||||
expect(diagram.get('elementRegistry').get('_b467921a-ef7b-44c5-bf78-fd624c400d17')).to.be.defined;
|
expect(diagram.get('elementRegistry').get('_b467921a-ef7b-44c5-bf78-fd624c400d17')).to.exist;
|
||||||
expect(diagram.get('elementRegistry').get('_c311cc87-677e-47a4-bdb1-8744c4ec3147')).to.be.defined;
|
expect(diagram.get('elementRegistry').get('_c311cc87-677e-47a4-bdb1-8744c4ec3147')).to.exist;
|
||||||
|
|
||||||
done(err);
|
done(err);
|
||||||
});
|
});
|
||||||
|
|
|
@ -53,7 +53,7 @@ describe('import - model wiring', function() {
|
||||||
var label = startEventShape.label;
|
var label = startEventShape.label;
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(label).to.be.defined;
|
expect(label).to.exist;
|
||||||
expect(label.id).to.equal(startEventShape.id + '_label');
|
expect(label.id).to.equal(startEventShape.id + '_label');
|
||||||
|
|
||||||
expect(label.labelTarget).to.eql(startEventShape);
|
expect(label.labelTarget).to.eql(startEventShape);
|
||||||
|
@ -70,10 +70,10 @@ describe('import - model wiring', function() {
|
||||||
startEvent = startEventShape.businessObject;
|
startEvent = startEventShape.businessObject;
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(subProcess).to.be.defined;
|
expect(subProcess).to.exist;
|
||||||
expect(is(subProcess, 'bpmn:SubProcess')).to.be.true;
|
expect(is(subProcess, 'bpmn:SubProcess')).to.be.true;
|
||||||
|
|
||||||
expect(startEvent).to.be.defined;
|
expect(startEvent).to.exist;
|
||||||
expect(is(startEvent, 'bpmn:StartEvent')).to.be.true;
|
expect(is(startEvent, 'bpmn:StartEvent')).to.be.true;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ describe('import - model wiring', function() {
|
||||||
var subProcessDi = subProcess.di;
|
var subProcessDi = subProcess.di;
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(subProcessDi).to.be.defined;
|
expect(subProcessDi).to.exist;
|
||||||
expect(subProcessDi.bpmnElement).to.eql(subProcess);
|
expect(subProcessDi.bpmnElement).to.eql(subProcess);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ describe('import - model wiring', function() {
|
||||||
var sequenceFlowDi = sequenceFlow.di;
|
var sequenceFlowDi = sequenceFlow.di;
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(sequenceFlowDi).to.be.defined;
|
expect(sequenceFlowDi).to.exist;
|
||||||
expect(sequenceFlowDi.bpmnElement).to.eql(sequenceFlow);
|
expect(sequenceFlowDi.bpmnElement).to.eql(sequenceFlow);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ describe('import - associations', function() {
|
||||||
var association = elementRegistry.get('Association_1');
|
var association = elementRegistry.get('Association_1');
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(association).to.be.defined;
|
expect(association).to.exist;
|
||||||
|
|
||||||
done();
|
done();
|
||||||
})();
|
})();
|
||||||
|
@ -52,7 +52,7 @@ describe('import - associations', function() {
|
||||||
var association = elementRegistry.get('Association_1');
|
var association = elementRegistry.get('Association_1');
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(association).to.be.defined;
|
expect(association).to.exist;
|
||||||
|
|
||||||
done();
|
done();
|
||||||
})();
|
})();
|
||||||
|
@ -83,8 +83,8 @@ describe('import - associations', function() {
|
||||||
var dataOutputAssociation = elementRegistry.get('DataOutputAssociation_1');
|
var dataOutputAssociation = elementRegistry.get('DataOutputAssociation_1');
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(dataInputAssociation).to.be.defined;
|
expect(dataInputAssociation).to.exist;
|
||||||
expect(dataOutputAssociation).to.be.defined;
|
expect(dataOutputAssociation).to.exist;
|
||||||
|
|
||||||
done();
|
done();
|
||||||
})();
|
})();
|
||||||
|
@ -111,8 +111,8 @@ describe('import - associations', function() {
|
||||||
var dataOutputAssociation = elementRegistry.get('DataOutputAssociation_1');
|
var dataOutputAssociation = elementRegistry.get('DataOutputAssociation_1');
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(dataInputAssociation).to.be.defined;
|
expect(dataInputAssociation).to.exist;
|
||||||
expect(dataOutputAssociation).to.be.defined;
|
expect(dataOutputAssociation).to.exist;
|
||||||
|
|
||||||
done();
|
done();
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in New Issue