From 33156e43be92b57bdef0f3b7e965ce36b105fe1f Mon Sep 17 00:00:00 2001 From: Maciej Barelkowski Date: Mon, 19 Aug 2019 10:39:20 +0200 Subject: [PATCH] chore(project): fix linting errors --- lib/Modeler.js | 2 ++ lib/draw/BpmnRenderer.js | 1 + lib/features/auto-place/AutoPlaceUtil.js | 1 + .../context-pad/ContextPadProvider.js | 3 +++ .../editor-actions/BpmnEditorActions.js | 1 + lib/features/modeling/BpmnLayouter.js | 3 +++ lib/features/modeling/BpmnUpdater.js | 6 ++++++ lib/features/modeling/ElementFactory.js | 1 + .../modeling/behavior/DropOnFlowBehavior.js | 2 ++ .../modeling/behavior/IsHorizontalFix.js | 1 + .../behavior/RemoveParticipantBehavior.js | 1 + .../modeling/behavior/ResizeLaneBehavior.js | 1 + .../ToggleElementCollapseBehaviour.js | 4 ++++ .../modeling/behavior/util/GeometricUtil.js | 1 + .../modeling/behavior/util/LineIntersect.js | 1 + lib/features/modeling/cmd/SplitLaneHandler.js | 2 ++ .../modeling/cmd/UpdatePropertiesHandler.js | 1 + lib/features/ordering/BpmnOrderingProvider.js | 1 + .../popup-menu/ReplaceMenuProvider.js | 2 ++ lib/features/replace/BpmnReplace.js | 6 ++++++ lib/features/replace/ReplaceOptions.js | 2 ++ lib/features/rules/BpmnRules.js | 1 + lib/import/BpmnImporter.js | 2 ++ lib/import/BpmnTreeWalker.js | 3 +++ test/helper/index.js | 1 + test/integration/CustomElementsSpec.js | 3 +++ .../custom-elements/CustomRules.js | 1 + test/spec/ViewerSpec.js | 8 ++++++++ .../context-pad/ContextPadProviderSpec.js | 1 + .../editor-actions/BpmnEditorActionsSpec.js | 2 ++ .../spec/features/modeling/AppendShapeSpec.js | 1 + .../spec/features/modeling/BpmnUpdaterSpec.js | 1 + test/spec/features/modeling/IdClaimSpec.js | 2 ++ .../spec/features/modeling/LabelBoundsSpec.js | 2 ++ test/spec/features/modeling/MoveRulesSpec.js | 1 + .../behavior/DataStoreBehaviorSpec.js | 1 + .../behavior/DropOnFlowBehaviorSpec.js | 3 +++ .../modeling/behavior/IsHorizontalFixSpec.js | 2 ++ .../behavior/RemoveElementBehaviorSpec.js | 1 + .../ToggleElementCollapseBehaviourSpec.js | 2 ++ .../behavior/UnsetDefaultFlowBehaviorSpec.js | 4 ++++ .../behavior/util/GeometricUtilSpec.js | 1 + .../behavior/util/LabelLayoutUtilSpec.js | 5 +++++ .../behavior/util/LineAttachmentUtilSpec.js | 8 ++++++++ .../modeling/layout/LayoutMessageFlowSpec.js | 1 + .../modeling/layout/LayoutSequenceFlowSpec.js | 4 ++++ .../popup-menu/ReplaceMenuProviderSpec.js | 19 +++++++++++++++++++ test/spec/features/rules/BpmnRulesSpec.js | 8 ++++++++ .../features/search/BpmnSearchProviderSpec.js | 8 ++++++++ test/util/custom-rules/CustomRules.js | 1 + 50 files changed, 140 insertions(+) diff --git a/lib/Modeler.js b/lib/Modeler.js index 4b8ffd61..fed04c24 100644 --- a/lib/Modeler.js +++ b/lib/Modeler.js @@ -197,6 +197,7 @@ Modeler.prototype._collectIds = function(definitions, context) { }; Modeler.prototype._interactionModules = [ + // non-modeling components KeyboardMoveModule, MoveCanvasModule, @@ -205,6 +206,7 @@ Modeler.prototype._interactionModules = [ ]; Modeler.prototype._modelingModules = [ + // modeling components AlignElementsModule, AutoPlaceModule, diff --git a/lib/draw/BpmnRenderer.js b/lib/draw/BpmnRenderer.js index 4d4df555..2f0883e0 100644 --- a/lib/draw/BpmnRenderer.js +++ b/lib/draw/BpmnRenderer.js @@ -1154,6 +1154,7 @@ export default function BpmnRenderer( var text = getSemantic(element).name; renderLaneLabel(parentGfx, text, element); } else { + // Collapsed pool draw text inline var text2 = getSemantic(element).name; renderLabel(parentGfx, text2, { diff --git a/lib/features/auto-place/AutoPlaceUtil.js b/lib/features/auto-place/AutoPlaceUtil.js index 220045df..58db28e2 100644 --- a/lib/features/auto-place/AutoPlaceUtil.js +++ b/lib/features/auto-place/AutoPlaceUtil.js @@ -151,6 +151,7 @@ export function getFlowNodeDistance(source, element) { getTargets(source, isReference).map(toTargetNode(5)), getSources(source, isReference).map(toSourceNode(1)) ), function(nodes, node) { + // filter out shapes connected twice via source or target nodes[node.shape.id + '__weight_' + node.weight] = node; diff --git a/lib/features/context-pad/ContextPadProvider.js b/lib/features/context-pad/ContextPadProvider.js index 91c4a172..63adf155 100644 --- a/lib/features/context-pad/ContextPadProvider.js +++ b/lib/features/context-pad/ContextPadProvider.js @@ -185,6 +185,7 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) { function splitLaneHandler(count) { return function(event, element) { + // actual split modeling.splitLane(element, count); @@ -338,6 +339,7 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) { } if (!popupMenu.isEmpty(element, 'bpmn-replace')) { + // Replace menu entry assign(actions, { 'replace': { @@ -400,6 +402,7 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) { var deleteAllowed = rules.allowed('elements.delete', { elements: [ element ] }); if (isArray(deleteAllowed)) { + // was the element returned as a deletion candidate? deleteAllowed = deleteAllowed[0] === element; } diff --git a/lib/features/editor-actions/BpmnEditorActions.js b/lib/features/editor-actions/BpmnEditorActions.js index d97c8126..b5585884 100644 --- a/lib/features/editor-actions/BpmnEditorActions.js +++ b/lib/features/editor-actions/BpmnEditorActions.js @@ -56,6 +56,7 @@ BpmnEditorActions.prototype._registerDefaultActions = function(injector) { if (canvas && elementRegistry && selection) { this._registerAction('selectElements', function() { + // select all elements except for the invisible // root element var rootElement = canvas.getRootElement(); diff --git a/lib/features/modeling/BpmnLayouter.js b/lib/features/modeling/BpmnLayouter.js index b708e6a9..b90aa385 100644 --- a/lib/features/modeling/BpmnLayouter.js +++ b/lib/features/modeling/BpmnLayouter.js @@ -352,6 +352,7 @@ function getBoundaryEventTargetLayout(attachOrientation, targetOrientation, atta // attached to either top, right, bottom or left side if (attachedToSide) { if (isHorizontalOrientation(attachOrientation)) { + // orientation is 'right' or 'left' // opposite horizontal orientation or same orientation @@ -365,6 +366,7 @@ function getBoundaryEventTargetLayout(attachOrientation, targetOrientation, atta // fallback return 'v'; } else { + // orientation is 'top' or 'bottom' // opposite vertical orientation or same orientation @@ -379,6 +381,7 @@ function getBoundaryEventTargetLayout(attachOrientation, targetOrientation, atta return 'h'; } } + // attached to either top-right, top-left, bottom-right or bottom-left corner // orientation is 'right', 'left' diff --git a/lib/features/modeling/BpmnUpdater.js b/lib/features/modeling/BpmnUpdater.js index 820cf63b..feb97275 100644 --- a/lib/features/modeling/BpmnUpdater.js +++ b/lib/features/modeling/BpmnUpdater.js @@ -77,6 +77,7 @@ export default function BpmnUpdater( var context = e.context; var element = context.shape || context.connection, + // oldParent is the (old) new parent, because we are undoing oldParent = context.parent || context.newParent; @@ -310,6 +311,7 @@ BpmnUpdater.prototype.updateAttachment = function(context) { }; BpmnUpdater.prototype.updateParent = function(element, oldParent) { + // do not update BPMN 2.0 label parent if (element instanceof Label) { return; @@ -517,6 +519,7 @@ BpmnUpdater.prototype.updateSemanticParent = function(businessObject, newParent, if (is(newParent, 'bpmn:Lane')) { do { + // unwrap Lane -> LaneSet -> (Lane | FlowElementsContainer) newParent = newParent.$parent.$parent; } while (is(newParent, 'bpmn:Lane')); @@ -596,6 +599,7 @@ BpmnUpdater.prototype.updateSemanticParent = function(businessObject, newParent, var children; if (businessObject.$parent) { + // remove from old parent children = businessObject.$parent.get(containment); collectionRemove(children, businessObject); @@ -604,6 +608,7 @@ BpmnUpdater.prototype.updateSemanticParent = function(businessObject, newParent, if (!newParent) { businessObject.$parent = null; } else { + // add to new parent children = newParent.get(containment); children.push(businessObject); @@ -671,6 +676,7 @@ BpmnUpdater.prototype.updateConnection = function(context) { } else if (is(businessObject, 'bpmn:DataInputAssociation')) { + // handle obnoxious isMsome sourceRef businessObject.get('sourceRef')[0] = newSource; diff --git a/lib/features/modeling/ElementFactory.js b/lib/features/modeling/ElementFactory.js index 81055783..36e8aab6 100644 --- a/lib/features/modeling/ElementFactory.js +++ b/lib/features/modeling/ElementFactory.js @@ -41,6 +41,7 @@ ElementFactory.$inject = [ ElementFactory.prototype.baseCreate = BaseElementFactory.prototype.create; ElementFactory.prototype.create = function(elementType, attrs) { + // no special magic for labels, // we assume their businessObjects have already been created // and wired via attrs diff --git a/lib/features/modeling/behavior/DropOnFlowBehavior.js b/lib/features/modeling/behavior/DropOnFlowBehavior.js index 9e0b8980..4d1c35ba 100644 --- a/lib/features/modeling/behavior/DropOnFlowBehavior.js +++ b/lib/features/modeling/behavior/DropOnFlowBehavior.js @@ -62,6 +62,7 @@ export default function DropOnFlowBehavior(eventBus, bpmnRules, modeling) { target = targetFlow.target; if (bpmnRules.canConnect(source, shape, targetFlow)) { + // reconnect source -> inserted shape modeling.reconnectEnd(targetFlow, shape, waypointsBefore || position); @@ -71,6 +72,7 @@ export default function DropOnFlowBehavior(eventBus, bpmnRules, modeling) { if (bpmnRules.canConnect(shape, target, targetFlow)) { if (!incomingConnection) { + // reconnect inserted shape -> end modeling.reconnectStart(targetFlow, shape, waypointsAfter || position); diff --git a/lib/features/modeling/behavior/IsHorizontalFix.js b/lib/features/modeling/behavior/IsHorizontalFix.js index 6697f4af..b9ded0ce 100644 --- a/lib/features/modeling/behavior/IsHorizontalFix.js +++ b/lib/features/modeling/behavior/IsHorizontalFix.js @@ -29,6 +29,7 @@ export default function IsHorizontalFix(eventBus) { var bo = getBusinessObject(event.context.shape); if (isAny(bo, elementTypesToUpdate) && !bo.di.get('isHorizontal')) { + // set attribute directly to avoid modeling#updateProperty side effects bo.di.set('isHorizontal', true); } diff --git a/lib/features/modeling/behavior/RemoveParticipantBehavior.js b/lib/features/modeling/behavior/RemoveParticipantBehavior.js index da30e508..60ce6780 100644 --- a/lib/features/modeling/behavior/RemoveParticipantBehavior.js +++ b/lib/features/modeling/behavior/RemoveParticipantBehavior.js @@ -35,6 +35,7 @@ export default function RemoveParticipantBehavior(eventBus, modeling) { var collaborationRoot = context.collaborationRoot; if (collaborationRoot && !collaborationRoot.businessObject.participants.length) { + // replace empty collaboration with process diagram modeling.makeProcess(); } diff --git a/lib/features/modeling/behavior/ResizeLaneBehavior.js b/lib/features/modeling/behavior/ResizeLaneBehavior.js index ca031403..c8981a92 100644 --- a/lib/features/modeling/behavior/ResizeLaneBehavior.js +++ b/lib/features/modeling/behavior/ResizeLaneBehavior.js @@ -42,6 +42,7 @@ export default function ResizeLaneBehavior(eventBus, modeling) { if (is(shape, 'bpmn:Lane') || is(shape, 'bpmn:Participant')) { if (canExecute) { + // ensure we have actual pixel values for new bounds // (important when zoom level was > 1 during move) newBounds = roundBounds(newBounds); diff --git a/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.js b/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.js index b1e67a3a..3e988d0f 100644 --- a/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.js +++ b/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.js @@ -43,6 +43,7 @@ export default function ToggleElementCollapseBehaviour( visibleBBox = computeChildrenBBox(visibleElements); if (visibleBBox) { + // center to visibleBBox with max(defaultSize, childrenBounds) newBounds.width = Math.max(visibleBBox.width, newBounds.width); newBounds.height = Math.max(visibleBBox.height, newBounds.height); @@ -50,6 +51,7 @@ export default function ToggleElementCollapseBehaviour( newBounds.x = visibleBBox.x + (visibleBBox.width - newBounds.width) / 2; newBounds.y = visibleBBox.y + (visibleBBox.height - newBounds.height) / 2; } else { + // center to collapsed shape with defaultSize newBounds.x = shape.x + (shape.width - newBounds.width) / 2; newBounds.y = shape.y + (shape.height - newBounds.height) / 2; @@ -78,12 +80,14 @@ export default function ToggleElementCollapseBehaviour( } if (!shape.collapsed) { + // all children got made visible through djs, hide empty labels hideEmptyLables(shape.children); // remove collapsed marker getBusinessObject(shape).di.isExpanded = true; } else { + // place collapsed marker getBusinessObject(shape).di.isExpanded = false; } diff --git a/lib/features/modeling/behavior/util/GeometricUtil.js b/lib/features/modeling/behavior/util/GeometricUtil.js index c87f18da..e7d8b650 100644 --- a/lib/features/modeling/behavior/util/GeometricUtil.js +++ b/lib/features/modeling/behavior/util/GeometricUtil.js @@ -16,6 +16,7 @@ export function vectorLength(v) { * @return {Float} */ export function getAngle(line) { + // return value is between 0, 180 and -180, -0 // @janstuemmel: maybe replace return a/b with b/a return Math.atan((line[1].y - line[0].y) / (line[1].x - line[0].x)); diff --git a/lib/features/modeling/behavior/util/LineIntersect.js b/lib/features/modeling/behavior/util/LineIntersect.js index b7335f82..a26f920d 100644 --- a/lib/features/modeling/behavior/util/LineIntersect.js +++ b/lib/features/modeling/behavior/util/LineIntersect.js @@ -9,6 +9,7 @@ * @return {Point} */ export default function lineIntersect(l1s, l1e, l2s, l2e) { + // if the lines intersect, the result contains the x and y of the // intersection (treating the lines as infinite) and booleans for // whether line segment 1 or line segment 2 contain the point diff --git a/lib/features/modeling/cmd/SplitLaneHandler.js b/lib/features/modeling/cmd/SplitLaneHandler.js index 86132d42..fa6fcb98 100644 --- a/lib/features/modeling/cmd/SplitLaneHandler.js +++ b/lib/features/modeling/cmd/SplitLaneHandler.js @@ -69,9 +69,11 @@ SplitLaneHandler.prototype.preExecute = function(context) { }; if (idx < existingLanesCount) { + // resize existing lane modeling.resizeShape(childLanes[idx], laneBounds); } else { + // create a new lane at position newLaneAttrs = { type: 'bpmn:Lane' diff --git a/lib/features/modeling/cmd/UpdatePropertiesHandler.js b/lib/features/modeling/cmd/UpdatePropertiesHandler.js index fd0a4772..19cb3d8e 100644 --- a/lib/features/modeling/cmd/UpdatePropertiesHandler.js +++ b/lib/features/modeling/cmd/UpdatePropertiesHandler.js @@ -193,6 +193,7 @@ function setProperties(businessObject, properties) { if (key !== DI) { businessObject.set(key, value); } else { + // only update, if businessObject.di exists if (businessObject.di) { setDiProperties(businessObject.di, value); diff --git a/lib/features/ordering/BpmnOrderingProvider.js b/lib/features/ordering/BpmnOrderingProvider.js index 100b48bd..26659dea 100644 --- a/lib/features/ordering/BpmnOrderingProvider.js +++ b/lib/features/ordering/BpmnOrderingProvider.js @@ -34,6 +34,7 @@ export default function BpmnOrderingProvider(eventBus, canvas, translate) { ] } }, + // handle DataAssociation(s) like message flows and render them always on top { type: 'bpmn:DataAssociation', diff --git a/lib/features/popup-menu/ReplaceMenuProvider.js b/lib/features/popup-menu/ReplaceMenuProvider.js index 1ccf481e..e7602391 100644 --- a/lib/features/popup-menu/ReplaceMenuProvider.js +++ b/lib/features/popup-menu/ReplaceMenuProvider.js @@ -327,12 +327,14 @@ ReplaceMenuProvider.prototype._createSequenceFlowEntries = function(element, rep } break; default: + // default flows if (is(businessObject.sourceRef, 'bpmn:Activity') && businessObject.conditionExpression) { return menuEntries.push(self._createMenuEntry(entry, element, function() { modeling.updateProperties(element, { conditionExpression: undefined }); })); } + // conditional flows if ((is(businessObject.sourceRef, 'bpmn:ExclusiveGateway') || is(businessObject.sourceRef, 'bpmn:InclusiveGateway') || diff --git a/lib/features/replace/BpmnReplace.js b/lib/features/replace/BpmnReplace.js index 6f0375be..da750921 100644 --- a/lib/features/replace/BpmnReplace.js +++ b/lib/features/replace/BpmnReplace.js @@ -54,11 +54,13 @@ function toggeling(element, target) { var targetCollapsed; if (target && (has(target, 'collapsed') || has(target, 'isExpanded'))) { + // property is explicitly set so use it targetCollapsed = ( has(target, 'collapsed') ? target.collapsed : !target.isExpanded ); } else { + // keep old state targetCollapsed = oldCollapsed; } @@ -105,6 +107,7 @@ export default function BpmnReplace( if (isSubProcess(oldBusinessObject)) { if (type === 'bpmn:SubProcess') { if (toggeling(element, target)) { + // expanding or collapsing process modeling.toggleCollapse(element); @@ -176,9 +179,11 @@ export default function BpmnReplace( if (is(oldBusinessObject, 'bpmn:Activity')) { if (isSubProcess(oldBusinessObject)) { + // no toggeling, so keep old state newElement.isExpanded = isExpanded(oldBusinessObject); } + // else if property is explicitly set, use it else if (target && has(target, 'isExpanded')) { newElement.isExpanded = target.isExpanded; @@ -205,6 +210,7 @@ export default function BpmnReplace( if (target.isExpanded === true) { newBusinessObject.processRef = bpmnFactory.create('bpmn:Process'); } else { + // remove children when transforming to collapsed pool hints.moveChildren = false; } diff --git a/lib/features/replace/ReplaceOptions.js b/lib/features/replace/ReplaceOptions.js index 92eea363..04cb6ab2 100644 --- a/lib/features/replace/ReplaceOptions.js +++ b/lib/features/replace/ReplaceOptions.js @@ -311,6 +311,7 @@ export var GATEWAY = [ eventGatewayType: 'Exclusive' } } + // Gateways deactivated until https://github.com/bpmn-io/bpmn-js/issues/194 // { // label: 'Event based instantiating Gateway', @@ -775,6 +776,7 @@ export var PARTICIPANT = [ { label: 'Collapsed Pool', actionName: 'replace-with-collapsed-pool', + // TODO(@janstuemmel): maybe design new icon className: 'bpmn-icon-lane', target: { diff --git a/lib/features/rules/BpmnRules.js b/lib/features/rules/BpmnRules.js index c3eab9ff..59764553 100644 --- a/lib/features/rules/BpmnRules.js +++ b/lib/features/rules/BpmnRules.js @@ -79,6 +79,7 @@ BpmnRules.prototype.init = function() { try { return canConnect(source, target); } finally { + // unset temporary target parent if (targetParent) { target.parent = null; diff --git a/lib/import/BpmnImporter.js b/lib/import/BpmnImporter.js index 39862a73..07938fd5 100644 --- a/lib/import/BpmnImporter.js +++ b/lib/import/BpmnImporter.js @@ -185,6 +185,7 @@ BpmnImporter.prototype.add = function(semantic, parentElement) { semantic: elementToString(semantic) })); } + // (optional) LABEL if (isLabelExternal(semantic) && getLabel(element)) { this.addLabel(semantic, element); @@ -246,6 +247,7 @@ BpmnImporter.prototype.addLabel = function(semantic, element) { text = getLabel(element); if (text) { + // get corrected bounds from actual layouted text bounds = this._textRenderer.getExternalLabelBounds(bounds, text); } diff --git a/lib/import/BpmnTreeWalker.js b/lib/import/BpmnTreeWalker.js index 1193441b..eaee6061 100644 --- a/lib/import/BpmnTreeWalker.js +++ b/lib/import/BpmnTreeWalker.js @@ -156,6 +156,7 @@ export default function BpmnTreeWalker(handler, translate) { * @throws {Error} if no diagram to display could be found */ function handleDefinitions(definitions, diagram) { + // make sure we walk the correct bpmnElement var diagrams = definitions.diagrams; @@ -399,6 +400,7 @@ export default function BpmnTreeWalker(handler, translate) { } else if (is(e, 'bpmn:FlowNode')) { handleFlowNode(e, context); } else if (is(e, 'bpmn:DataObject')) { + // SKIP (assume correct referencing via DataObjectReference) } else if (is(e, 'bpmn:DataStoreReference')) { handleDataElement(e, context); @@ -439,6 +441,7 @@ export default function BpmnTreeWalker(handler, translate) { function wireFlowNodeRefs(lane) { + // wire the virtual flowNodeRefs <-> relationship forEach(lane.flowNodeRef, function(flowNode) { var lanes = flowNode.get('lanes'); diff --git a/test/helper/index.js b/test/helper/index.js index bce83a2d..8c73bc3b 100644 --- a/test/helper/index.js +++ b/test/helper/index.js @@ -57,6 +57,7 @@ export function bootstrapBpmnJS(BpmnJS, diagram, options, locals) { // This is needed if other libraries rely on this helper for testing // while not adding the mocha-test-container-support as a dependency. try { + // 'this' is the current test context testContainer = TestContainer.get(this); } catch (e) { diff --git a/test/integration/CustomElementsSpec.js b/test/integration/CustomElementsSpec.js index 6a0c38c7..f64d2c7b 100644 --- a/test/integration/CustomElementsSpec.js +++ b/test/integration/CustomElementsSpec.js @@ -54,6 +54,7 @@ describe('custom elements', function() { it('should render custom elements', inject(function(elementRegistry) { + // when // then @@ -63,6 +64,7 @@ describe('custom elements', function() { it('should get the correct custom elements path', inject(function(graphicsFactory) { + // when var trianglePath = graphicsFactory.getShapePath(triangle), circlePath = graphicsFactory.getShapePath(circle); @@ -74,6 +76,7 @@ describe('custom elements', function() { it('should still render bpmn elements', inject(function(elementFactory) { + // when var startEvent = elementFactory.createShape({ type: 'bpmn:StartEvent' }); diff --git a/test/integration/custom-elements/CustomRules.js b/test/integration/custom-elements/CustomRules.js index 259659ce..c31d6a70 100644 --- a/test/integration/custom-elements/CustomRules.js +++ b/test/integration/custom-elements/CustomRules.js @@ -47,6 +47,7 @@ CustomRules.prototype.init = function() { }); this.addRule('connection.updateWaypoints', HIGH_PRIORITY, function(context) { + // OK! but visually ignore return null; }); diff --git a/test/spec/ViewerSpec.js b/test/spec/ViewerSpec.js index 560102f5..b1fdfc33 100644 --- a/test/spec/ViewerSpec.js +++ b/test/spec/ViewerSpec.js @@ -644,6 +644,7 @@ describe('Viewer', function() { 'import.render.complete', 'import.done' ], function(e) { + // log event type + event arguments events.push([ e.type, @@ -812,6 +813,7 @@ describe('Viewer', function() { 'import.render.complete', 'import.done' ], function(e) { + // log event type + event arguments events.push([ e.type, @@ -839,6 +841,7 @@ describe('Viewer', function() { // given viewer.on('import.render.complete', function(context) { + // then done(context.error); }); @@ -1169,6 +1172,7 @@ describe('Viewer', function() { 'import.render.complete', 'import.done' ], function(e) { + // log event type + event arguments events.push([ e.type, @@ -1232,6 +1236,7 @@ describe('Viewer', function() { 'saveXML.serialized', 'saveXML.done' ], function(e) { + // log event type + event arguments events.push([ e.type, @@ -1245,6 +1250,7 @@ describe('Viewer', function() { // when viewer.saveXML(function(err) { + // then expect(events).to.eql([ [ 'saveXML.start', [ 'definitions' ] ], @@ -1405,6 +1411,7 @@ describe('Viewer', function() { 'saveSVG.start', 'saveSVG.done' ], function(e) { + // log event type + event arguments events.push([ e.type, @@ -1418,6 +1425,7 @@ describe('Viewer', function() { // when viewer.saveSVG(function() { + // then expect(events).to.eql([ [ 'saveSVG.start', [ ] ], diff --git a/test/spec/features/context-pad/ContextPadProviderSpec.js b/test/spec/features/context-pad/ContextPadProviderSpec.js index b6dc4aad..535ca9c4 100644 --- a/test/spec/features/context-pad/ContextPadProviderSpec.js +++ b/test/spec/features/context-pad/ContextPadProviderSpec.js @@ -476,6 +476,7 @@ describe('features - context-pad', function() { it('should not open non-existing replace menu', inject( function(create, dragging, canvas, elementFactory) { + // given var rootShape = canvas.getRootElement(), dataObject = elementFactory.createShape({ type: 'bpmn:DataObjectReference' }), diff --git a/test/spec/features/editor-actions/BpmnEditorActionsSpec.js b/test/spec/features/editor-actions/BpmnEditorActionsSpec.js index 20b21a1c..55199744 100644 --- a/test/spec/features/editor-actions/BpmnEditorActionsSpec.js +++ b/test/spec/features/editor-actions/BpmnEditorActionsSpec.js @@ -37,6 +37,7 @@ describe('features/editor-actions', function() { it('should move to origin', inject(function(editorActions) { + // given var elements = editorActions.trigger('selectElements'), boundingBox; @@ -73,6 +74,7 @@ describe('features/editor-actions', function() { it('should ignore children of subprocesses', inject( function(editorActions, elementRegistry) { + // given var startEvent = elementRegistry.get('StartEvent_3'), startEventParent = getParent(startEvent); diff --git a/test/spec/features/modeling/AppendShapeSpec.js b/test/spec/features/modeling/AppendShapeSpec.js index d87af993..5bdc48cc 100644 --- a/test/spec/features/modeling/AppendShapeSpec.js +++ b/test/spec/features/modeling/AppendShapeSpec.js @@ -22,6 +22,7 @@ describe('features/modeling - append shape', function() { describe('shape handling', function() { it('should execute', inject(function(elementRegistry, modeling) { + // given var startEventShape = elementRegistry.get('StartEvent_1'); diff --git a/test/spec/features/modeling/BpmnUpdaterSpec.js b/test/spec/features/modeling/BpmnUpdaterSpec.js index 5f0f9795..2da363f6 100644 --- a/test/spec/features/modeling/BpmnUpdaterSpec.js +++ b/test/spec/features/modeling/BpmnUpdaterSpec.js @@ -104,6 +104,7 @@ describe('features - bpmn-updater', function() { it('should crop connection only once per reconnect', inject( function(modeling, elementRegistry, connectionDocking) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_1'), target = elementRegistry.get('EndEvent_2'), diff --git a/test/spec/features/modeling/IdClaimSpec.js b/test/spec/features/modeling/IdClaimSpec.js index f28dd9c3..9ff24b2e 100644 --- a/test/spec/features/modeling/IdClaimSpec.js +++ b/test/spec/features/modeling/IdClaimSpec.js @@ -27,6 +27,7 @@ describe('features/modeling - id claim management', function() { describe('unclaim', function() { it('should unclaim id when removing element', inject(function(modeling, moddle) { + // when modeling.removeElements([ element ]); @@ -36,6 +37,7 @@ describe('features/modeling - id claim management', function() { it('should revert unclaim action on restoring element', inject(function(modeling, moddle, commandStack) { + // given modeling.removeElements([ element ]); diff --git a/test/spec/features/modeling/LabelBoundsSpec.js b/test/spec/features/modeling/LabelBoundsSpec.js index 931bcc67..dbac85a7 100644 --- a/test/spec/features/modeling/LabelBoundsSpec.js +++ b/test/spec/features/modeling/LabelBoundsSpec.js @@ -87,6 +87,7 @@ describe('label bounds', function() { it('should reduce width', inject(function(elementRegistry) { + // given var shape = elementRegistry.get('StartEvent_1'), oldLabelWidth = shape.label.width; @@ -100,6 +101,7 @@ describe('label bounds', function() { it('should reduce height', inject(function(elementRegistry) { + // given var shape = elementRegistry.get('StartEvent_3'), oldLabelHeight = shape.label.height; diff --git a/test/spec/features/modeling/MoveRulesSpec.js b/test/spec/features/modeling/MoveRulesSpec.js index fd973c42..a9794fee 100644 --- a/test/spec/features/modeling/MoveRulesSpec.js +++ b/test/spec/features/modeling/MoveRulesSpec.js @@ -32,6 +32,7 @@ describe('features/modeling - move', function() { it('should not attach label when moving BoundaryEvent', inject(function(elementRegistry, move, dragging) { + // given var boundaryEvent = elementRegistry.get('BoundaryEvent_1'), subProcess = elementRegistry.get('SubProcess_1'), diff --git a/test/spec/features/modeling/behavior/DataStoreBehaviorSpec.js b/test/spec/features/modeling/behavior/DataStoreBehaviorSpec.js index d84a7aca..b3b3dc02 100644 --- a/test/spec/features/modeling/behavior/DataStoreBehaviorSpec.js +++ b/test/spec/features/modeling/behavior/DataStoreBehaviorSpec.js @@ -352,6 +352,7 @@ describe('features/modeling/behavior - data store', function() { beforeEach(bootstrapModeler(processDiagramXML, { modules: testModules })); beforeEach(inject(function(elementRegistry, modeling) { + // given var participantElement = elementRegistry.get('Participant'), participant2Element = elementRegistry.get('Participant_2'), diff --git a/test/spec/features/modeling/behavior/DropOnFlowBehaviorSpec.js b/test/spec/features/modeling/behavior/DropOnFlowBehaviorSpec.js index 37383b29..4392f998 100644 --- a/test/spec/features/modeling/behavior/DropOnFlowBehaviorSpec.js +++ b/test/spec/features/modeling/behavior/DropOnFlowBehaviorSpec.js @@ -169,6 +169,7 @@ describe('modeling/behavior - drop on connection', function() { it('should connect start -> target -> end (with bendpointBefore inside bbox)', inject( function(modeling, elementRegistry, elementFactory) { + // given var taskShape = elementFactory.createShape({ type: 'bpmn:Task' }), sequenceFlow = elementRegistry.get('SequenceFlow_1'), @@ -345,6 +346,7 @@ describe('modeling/behavior - drop on connection', function() { it('should connect start -> target -> end (with bendpointBefore inside bbox)', inject( function(elementRegistry, selection, move, dragging) { + // given var task3 = elementRegistry.get('Task_3'), sequenceFlow = elementRegistry.get('SequenceFlow_1'), @@ -378,6 +380,7 @@ describe('modeling/behavior - drop on connection', function() { it('should connect start -> target -> end (with bendpointAfter inside bbox)', inject( function(elementRegistry, selection, move, dragging) { + // given var task3 = elementRegistry.get('Task_3'), sequenceFlow = elementRegistry.get('SequenceFlow_1'), diff --git a/test/spec/features/modeling/behavior/IsHorizontalFixSpec.js b/test/spec/features/modeling/behavior/IsHorizontalFixSpec.js index 6e0334ab..8e1e6027 100644 --- a/test/spec/features/modeling/behavior/IsHorizontalFixSpec.js +++ b/test/spec/features/modeling/behavior/IsHorizontalFixSpec.js @@ -28,6 +28,7 @@ describe('features/modeling/behavior - IsHorizontalFix', function() { it('should set isHorizontal=true when participant is created', inject(function(canvas, elementFactory, modeling) { + // given var processShape = canvas.getRootElement(), participantShape = elementFactory.createParticipantShape(true); @@ -45,6 +46,7 @@ describe('features/modeling/behavior - IsHorizontalFix', function() { it('should set isHorizontal=true when lane is created', inject(function(canvas, elementFactory, modeling) { + // given var processShape = canvas.getRootElement(), participantShape = elementFactory.createParticipantShape(true), diff --git a/test/spec/features/modeling/behavior/RemoveElementBehaviorSpec.js b/test/spec/features/modeling/behavior/RemoveElementBehaviorSpec.js index 24f002dc..5b9ea287 100644 --- a/test/spec/features/modeling/behavior/RemoveElementBehaviorSpec.js +++ b/test/spec/features/modeling/behavior/RemoveElementBehaviorSpec.js @@ -60,6 +60,7 @@ describe('features/modeling - remove element behavior', function() { // then var waypoints = elementRegistry.get('SequenceFlow7').waypoints; + // connection has two vertically equal waypoints expect(waypoints).to.have.length(2); expect(waypoints[0].x).to.eql(waypoints[1].x); diff --git a/test/spec/features/modeling/behavior/ToggleElementCollapseBehaviourSpec.js b/test/spec/features/modeling/behavior/ToggleElementCollapseBehaviourSpec.js index 6b0cb5fb..9940619f 100644 --- a/test/spec/features/modeling/behavior/ToggleElementCollapseBehaviourSpec.js +++ b/test/spec/features/modeling/behavior/ToggleElementCollapseBehaviourSpec.js @@ -299,6 +299,7 @@ describe('features/modeling - collapse and expand elements', function() { originalChildren.forEach(function(c) { expect(collapsedSubProcess.children).to.include(c); }); + // and hide them expect(collapsedSubProcess.children).to.satisfy(allHidden()); }) @@ -634,6 +635,7 @@ function allShown() { function childrenHidden(hidden) { return function(children) { return children.every(function(child) { + // empty labels are allways hidden if (child.type === 'label' && !child.businessObject.name) { return child.hidden; diff --git a/test/spec/features/modeling/behavior/UnsetDefaultFlowBehaviorSpec.js b/test/spec/features/modeling/behavior/UnsetDefaultFlowBehaviorSpec.js index 6b5d3d28..2e7ddf63 100644 --- a/test/spec/features/modeling/behavior/UnsetDefaultFlowBehaviorSpec.js +++ b/test/spec/features/modeling/behavior/UnsetDefaultFlowBehaviorSpec.js @@ -27,6 +27,7 @@ describe('features/modeling - delete default connection', function() { it('should remove default connection', inject(function(modeling) { + // when modeling.removeConnection(defaultConnection); @@ -37,6 +38,7 @@ describe('features/modeling - delete default connection', function() { it('should revert default connection', inject(function(modeling, commandStack) { + // given modeling.removeConnection(defaultConnection); @@ -50,6 +52,7 @@ describe('features/modeling - delete default connection', function() { it('should NOT remove default connection on removing other connections', inject(function(modeling) { + // when modeling.removeConnection(normalConnection); @@ -62,6 +65,7 @@ describe('features/modeling - delete default connection', function() { it('should NOT remove default connection on restoring other connections', inject(function(modeling, commandStack) { + // given modeling.removeConnection(normalConnection); diff --git a/test/spec/features/modeling/behavior/util/GeometricUtilSpec.js b/test/spec/features/modeling/behavior/util/GeometricUtilSpec.js index e45b2fbb..6b31b292 100644 --- a/test/spec/features/modeling/behavior/util/GeometricUtilSpec.js +++ b/test/spec/features/modeling/behavior/util/GeometricUtilSpec.js @@ -98,6 +98,7 @@ describe('modeling/behavior/util - GeometricUtil', function() { // given var testVectors = [ + // x=-10 because we have system with flipped y axis { vector: { x: 0, y: 10 }, angle: 90, rotated: { x: -10, y: 0 } }, { vector: { x: 10, y: 0 }, angle: 90, rotated: { x: 0, y: 10 } }, diff --git a/test/spec/features/modeling/behavior/util/LabelLayoutUtilSpec.js b/test/spec/features/modeling/behavior/util/LabelLayoutUtilSpec.js index cbb8701b..619155ec 100644 --- a/test/spec/features/modeling/behavior/util/LabelLayoutUtilSpec.js +++ b/test/spec/features/modeling/behavior/util/LabelLayoutUtilSpec.js @@ -7,10 +7,13 @@ describe('modeling/behavior/util - LabelLayoutUtil#getLabelAdjustment', function var newLine = [ { x: 10, y: 10 }, + // - { x: 15, y: 10 }, + // | { x: 15, y: 5 }, + // - { x: 30, y: 5 } ]; @@ -21,6 +24,7 @@ describe('modeling/behavior/util - LabelLayoutUtil#getLabelAdjustment', function // given var line = [ { x: 10, y: 10 }, + // - { x: 20, y: 10 } ]; @@ -47,6 +51,7 @@ describe('modeling/behavior/util - LabelLayoutUtil#getLabelAdjustment', function // given var line = [ { x: 10, y: 10 }, + // - { x: 10, y: 10 } ]; diff --git a/test/spec/features/modeling/behavior/util/LineAttachmentUtilSpec.js b/test/spec/features/modeling/behavior/util/LineAttachmentUtilSpec.js index 83fb4faa..1f9ca2eb 100644 --- a/test/spec/features/modeling/behavior/util/LineAttachmentUtilSpec.js +++ b/test/spec/features/modeling/behavior/util/LineAttachmentUtilSpec.js @@ -15,10 +15,13 @@ describe('modeling/behavior/util - LineAttachmentUtil#getAttachment', function() // var line = [ { x: 10, y: 10 }, + // - { x: 30, y: 10 }, + // | { x: 30, y: 30 }, + // \ { x: 130, y: 130 } ]; @@ -199,10 +202,13 @@ describe('modeling/behavior/util - LineAttachmentUtil#getAttachment', function() // var floatingPointLine = [ { x: 10.141592, y: 10.653589 }, + // - { x: 30.793238, y: 10.462643 }, + // | { x: 30.383279, y: 30.502884 }, + // \ { x: 130.197169, y: 130.399375 } ]; @@ -246,6 +252,7 @@ describe('modeling/behavior/util - LineAttachmentUtil#getAttachment', function() var zeroLengthLine = [ { x: 10, y: 10 }, + // - { x: 10, y: 10 } ]; @@ -253,6 +260,7 @@ describe('modeling/behavior/util - LineAttachmentUtil#getAttachment', function() var zeroLengthFloatingPointLine = [ { x: 10.1, y: 10.12313 }, + // - { x: 10, y: 10.112 } ]; diff --git a/test/spec/features/modeling/layout/LayoutMessageFlowSpec.js b/test/spec/features/modeling/layout/LayoutMessageFlowSpec.js index d4f72cfd..1d18e594 100644 --- a/test/spec/features/modeling/layout/LayoutMessageFlowSpec.js +++ b/test/spec/features/modeling/layout/LayoutMessageFlowSpec.js @@ -181,6 +181,7 @@ describe('features/modeling - layout message flows', function() { // when modeling.moveElements([ participantShape ], { x: 300, y: 50 }); + // then // expect cropped, repaired manhattan connection diff --git a/test/spec/features/modeling/layout/LayoutSequenceFlowSpec.js b/test/spec/features/modeling/layout/LayoutSequenceFlowSpec.js index 6b572347..c8293380 100644 --- a/test/spec/features/modeling/layout/LayoutSequenceFlowSpec.js +++ b/test/spec/features/modeling/layout/LayoutSequenceFlowSpec.js @@ -229,6 +229,7 @@ describe('features/modeling - layout', function() { it('attached bottom center, orientation bottom', function() { + // when var connection = connect('BoundaryEvent_BottomCenter', 'Task_Bottom'); @@ -240,6 +241,7 @@ describe('features/modeling - layout', function() { it('attached top center, orientation top', function() { + // when var connection = connect('BoundaryEvent_TopCenter', 'Task_Top'); @@ -251,6 +253,7 @@ describe('features/modeling - layout', function() { it('attached right center, orientation right', function() { + // when var connection = connect('BoundaryEvent_RightCenter', 'Task_Right'); @@ -262,6 +265,7 @@ describe('features/modeling - layout', function() { it('attached right center, orientation left', function() { + // when var connection = connect('BoundaryEvent_RightCenter', 'Task_Left'); diff --git a/test/spec/features/popup-menu/ReplaceMenuProviderSpec.js b/test/spec/features/popup-menu/ReplaceMenuProviderSpec.js index dca58a15..f9461f07 100644 --- a/test/spec/features/popup-menu/ReplaceMenuProviderSpec.js +++ b/test/spec/features/popup-menu/ReplaceMenuProviderSpec.js @@ -908,6 +908,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should show default replace option [gateway]', inject(function(elementRegistry, popupMenu) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_3'); @@ -920,6 +921,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should show Default replace option [task]', inject(function(elementRegistry, popupMenu) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_15f5knn'); @@ -932,6 +934,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should NOT show default replace option', inject(function(elementRegistry, popupMenu) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_4'); @@ -955,6 +958,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should show default replace option', inject(function(elementRegistry, popupMenu) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_2'); @@ -971,6 +975,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should NOT show default replace option', inject(function(elementRegistry, popupMenu) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_1'); @@ -998,6 +1003,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should show default replace option', inject(function(elementRegistry, popupMenu) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_2'); @@ -1014,6 +1020,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should NOT show default replace option', inject(function(elementRegistry, popupMenu) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_1'); @@ -1041,6 +1048,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should show ConditionalFlow replace option', inject(function(elementRegistry, popupMenu) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_3'); @@ -1057,6 +1065,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should NOT show ConditionalFlow replace option', inject(function(elementRegistry, popupMenu) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_1'); @@ -1133,6 +1142,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should replace SequenceFlow with DefaultFlow [gateway]', inject(function(elementRegistry, popupMenu) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_3'); @@ -1151,6 +1161,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should replace SequenceFlow with DefaultFlow [task]', inject(function(elementRegistry, popupMenu) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_15f5knn'); @@ -1169,6 +1180,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should morph DefaultFlow into a SequenceFlow [task]', inject(function(elementRegistry, popupMenu) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_15f5knn'), entries; @@ -1224,6 +1236,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should morph DefaultFlow into a ConditionalFlow [task]', inject(function(elementRegistry, popupMenu) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_15f5knn'), task = elementRegistry.get('Task_1ei94kl'), @@ -1322,6 +1335,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should only have one DefaultFlow', inject(function(elementRegistry, popupMenu) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_1'), sequenceFlow3 = elementRegistry.get('SequenceFlow_3'); @@ -1514,6 +1528,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should keep DefaultFlow when morphing Gateway', inject(function(elementRegistry, popupMenu, bpmnReplace) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_3'), exclusiveGateway = elementRegistry.get('ExclusiveGateway_1'); @@ -1533,6 +1548,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should keep DefaultFlow when morphing Task', inject(function(elementRegistry, bpmnReplace, popupMenu) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_15f5knn'), task = elementRegistry.get('Task_1ei94kl'); @@ -1648,6 +1664,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should morph into a ConditionalFlow', inject(function(elementRegistry, popupMenu) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_2'); @@ -1665,6 +1682,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should morph into a ConditionalFlow -> undo', inject( function(elementRegistry, popupMenu, commandStack) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_2'); @@ -1684,6 +1702,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should morph back into a SequenceFlow', inject(function(elementRegistry, popupMenu) { + // given var sequenceFlow = elementRegistry.get('SequenceFlow_2'); diff --git a/test/spec/features/rules/BpmnRulesSpec.js b/test/spec/features/rules/BpmnRulesSpec.js index 3fe6e2b5..40cb6473 100644 --- a/test/spec/features/rules/BpmnRulesSpec.js +++ b/test/spec/features/rules/BpmnRulesSpec.js @@ -1199,6 +1199,7 @@ describe('features/modeling/rules - BpmnRules', function() { it('-> Collaboration', function() { + // then expectCanDrop(label, 'Collaboration', true); }); @@ -1249,6 +1250,7 @@ describe('features/modeling/rules - BpmnRules', function() { it('-> Collaboration', function() { + // then expectCanCreate(group, 'Collaboration', true); }); @@ -1508,6 +1510,7 @@ describe('features/modeling/rules - BpmnRules', function() { it('attach/move multiple BoundaryEvents -> SubProcess_1', inject( function(elementRegistry) { + // when var boundaryEvent = elementRegistry.get('BoundaryEvent_1'), boundaryEvent2 = elementRegistry.get('BoundaryEvent_2'); @@ -1527,6 +1530,7 @@ describe('features/modeling/rules - BpmnRules', function() { it('attach/move SubProcess, BoundaryEvent and label -> Process', inject( function(elementRegistry) { + // when var subProcess = elementRegistry.get('SubProcess_1'), boundaryEvent = elementRegistry.get('BoundaryEvent_1'), @@ -2108,6 +2112,7 @@ describe('features/modeling/rules - BpmnRules', function() { ]; types.forEach(function(type) { + // when var element = elementFactory.createShape({ type: type }); @@ -2231,6 +2236,7 @@ describe('features/modeling/rules - BpmnRules', function() { it('should allow start for given element types', inject(function(elementFactory, rules) { + // given var types = [ 'bpmn:FlowNode', @@ -2253,6 +2259,7 @@ describe('features/modeling/rules - BpmnRules', function() { it('should ignore label elements', inject(function(elementFactory, rules) { + // given var label = elementFactory.createShape({ type: 'bpmn:FlowNode', labelTarget: {} }); @@ -2265,6 +2272,7 @@ describe('features/modeling/rules - BpmnRules', function() { it('should NOT allow start on unknown element', inject(function(rules) { + // given var element = { type: 'bpmn:SomeUnknownType' }; diff --git a/test/spec/features/search/BpmnSearchProviderSpec.js b/test/spec/features/search/BpmnSearchProviderSpec.js index 95f9b37a..c1e82fce 100644 --- a/test/spec/features/search/BpmnSearchProviderSpec.js +++ b/test/spec/features/search/BpmnSearchProviderSpec.js @@ -24,6 +24,7 @@ describe('features - BPMN search provider', function() { it('should not return root element (collaboration)', inject(function(bpmnSearch) { + // given var pattern = 'collaboration'; @@ -43,6 +44,7 @@ describe('features - BPMN search provider', function() { it('find should return all elements that match label or ID', inject(function(bpmnSearch) { + // given var pattern = '123456'; @@ -60,6 +62,7 @@ describe('features - BPMN search provider', function() { it('matches IDs', inject(function(bpmnSearch) { + // given var pattern = 'datastore'; @@ -79,6 +82,7 @@ describe('features - BPMN search provider', function() { it('should not return root element (process)', inject(function(bpmnSearch) { + // given var pattern = 'process'; @@ -93,6 +97,7 @@ describe('features - BPMN search provider', function() { describe('should split result into matched and non matched tokens', function() { it('matched all', inject(function(bpmnSearch) { + // given var pattern = 'all matched'; @@ -107,6 +112,7 @@ describe('features - BPMN search provider', function() { it('matched start', inject(function(bpmnSearch) { + // given var pattern = 'before'; @@ -122,6 +128,7 @@ describe('features - BPMN search provider', function() { it('matched middle', inject(function(bpmnSearch) { + // given var pattern = 'middle'; @@ -138,6 +145,7 @@ describe('features - BPMN search provider', function() { it('matched end', inject(function(bpmnSearch) { + // given var pattern = 'after'; diff --git a/test/util/custom-rules/CustomRules.js b/test/util/custom-rules/CustomRules.js index 8cd83f21..8ee4066d 100644 --- a/test/util/custom-rules/CustomRules.js +++ b/test/util/custom-rules/CustomRules.js @@ -12,5 +12,6 @@ CustomRules.$inject = [ 'eventBus' ]; inherits(CustomRules, RuleProvider); CustomRules.prototype.init = function() { + // placeholder }; \ No newline at end of file