diff --git a/js/apps/system/aardvark/test/clusterSpecs/views/clusterDownViewSpec.js b/js/apps/system/aardvark/test/clusterSpecs/views/clusterDownViewSpec.js index 8823b17b70..fbb70ae346 100644 --- a/js/apps/system/aardvark/test/clusterSpecs/views/clusterDownViewSpec.js +++ b/js/apps/system/aardvark/test/clusterSpecs/views/clusterDownViewSpec.js @@ -20,6 +20,9 @@ isTestSetup : function () { return undefined; }, + cleanUp : function () { + return undefined; + }, destroy : function () { return undefined; } @@ -158,10 +161,12 @@ }); spyOn(window.App, "navigate"); spyOn(window.App.clusterPlan, "isTestSetup").andReturn(false); + spyOn(window.App.clusterPlan, "cleanUp"); spyOn(jquerydummy, "modal"); view.submitEditPlan(); expect(jquerydummy.modal).toHaveBeenCalledWith("hide"); + expect(window.App.clusterPlan.cleanUp).toHaveBeenCalled(); expect(window.App.navigate).toHaveBeenCalledWith("planAsymmetrical", {trigger : true}); }); @@ -178,9 +183,11 @@ }); spyOn(window.App, "navigate"); spyOn(window.App.clusterPlan, "isTestSetup").andReturn(true); + spyOn(window.App.clusterPlan, "cleanUp"); spyOn(jquerydummy, "modal"); view.submitEditPlan(); + expect(window.App.clusterPlan.cleanUp).toHaveBeenCalled(); expect(jquerydummy.modal).toHaveBeenCalledWith("hide"); expect(window.App.navigate).toHaveBeenCalledWith("planTest", {trigger : true}); @@ -198,13 +205,16 @@ return jquerydummy; } }); + spyOn(window, "ClusterPlan").andReturn(window.App.clusterPlan); spyOn(window.App, "navigate"); spyOn(window.App, "planScenario"); + spyOn(window.App.clusterPlan, "cleanUp"); spyOn(window.App.clusterPlan, "destroy"); spyOn(jquerydummy, "modal"); view.submitDeletePlan(); expect(jquerydummy.modal).toHaveBeenCalledWith("hide"); + expect(window.App.clusterPlan.cleanUp).toHaveBeenCalled(); expect(window.App.planScenario).toHaveBeenCalled(); }); diff --git a/js/server/modules/org/arangodb/ahuacatl.js b/js/server/modules/org/arangodb/ahuacatl.js index e8838d097a..16ca4e0ed1 100644 --- a/js/server/modules/org/arangodb/ahuacatl.js +++ b/js/server/modules/org/arangodb/ahuacatl.js @@ -5855,7 +5855,6 @@ function GENERAL_GRAPH_NEIGHBORS (graphName, options.startVertexCollectionRestriction = options.vertexCollectionRestriction; } } - var neighbors = [], params = TRAVERSAL_PARAMS(), factory = TRAVERSAL.generalGraphDatasourceFactory(graphName); @@ -5865,11 +5864,11 @@ function GENERAL_GRAPH_NEIGHBORS (graphName, params.paths = true; options.edgeExamples = options.edgeExamples || {}; params.visitor = TRAVERSAL_NEIGHBOR_VISITOR; - var graph = RESOLVE_GRAPH_TO_DOCUMENTS(graphName, options); - params.followEdges = MERGE_EXAMPLES_WITH_EDGES(options.edgeExamples, graph.edges); - + if (params.followEdges.length === 0) { + return []; + } graph.fromVertices.forEach(function (v) { var e = TRAVERSAL_FUNC("GRAPH_NEIGHBORS", factory,