From 958c507943ddb1c94d067f90d576dde0eb8e7d6e Mon Sep 17 00:00:00 2001 From: Michael Hackstein Date: Thu, 2 May 2013 14:39:36 +0200 Subject: [PATCH] GraphViewer: Fixes in NodeShaper --- html/admin/js/graphViewer/graph/nodeShaper.js | 2 +- .../specGraphViewer/graphViewerUISpec.js | 18 ++++++++++++++++++ .../specNodeShaper/nodeShaperSpec.js | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/html/admin/js/graphViewer/graph/nodeShaper.js b/html/admin/js/graphViewer/graph/nodeShaper.js index 97d69e46ee..2d4cff465f 100644 --- a/html/admin/js/graphViewer/graph/nodeShaper.js +++ b/html/admin/js/graphViewer/graph/nodeShaper.js @@ -171,7 +171,7 @@ function NodeShaper(parent, flags, idfunc) { addShape = noop; break; case NodeShaper.shapes.CIRCLE: - radius = shape.radius || 8; + radius = shape.radius || 25; addShape = function (node) { node.append("circle") // Display nodes as circles .attr("r", radius); // Set radius diff --git a/html/admin/js/graphViewer/jasmine_test/specGraphViewer/graphViewerUISpec.js b/html/admin/js/graphViewer/jasmine_test/specGraphViewer/graphViewerUISpec.js index 544bfd5163..547297eca7 100644 --- a/html/admin/js/graphViewer/jasmine_test/specGraphViewer/graphViewerUISpec.js +++ b/html/admin/js/graphViewer/jasmine_test/specGraphViewer/graphViewerUISpec.js @@ -324,6 +324,24 @@ }); + it('should load the graph on pressing enter', function() { + + runs(function() { + $("#contentDiv #menubar #value").attr("value", "0"); + var e = jQuery.Event("keypress"); + e.which = 13; + e.keyCode = 13; + $("body").trigger(e); + }); + + waits(waittime); + + runs(function() { + expect([0, 1, 2, 3, 4]).toBeDisplayed(); + }); + + }); + it('should load the graph by attribute and value', function() { runs(function() { diff --git a/html/admin/js/graphViewer/jasmine_test/specNodeShaper/nodeShaperSpec.js b/html/admin/js/graphViewer/jasmine_test/specNodeShaper/nodeShaperSpec.js index 787b600366..85fe54638f 100644 --- a/html/admin/js/graphViewer/jasmine_test/specNodeShaper/nodeShaperSpec.js +++ b/html/admin/js/graphViewer/jasmine_test/specNodeShaper/nodeShaperSpec.js @@ -128,7 +128,7 @@ expect($("svg circle").length).toEqual(1); expect($("svg .node circle")[0]).toBeDefined(); expect($("svg .node circle").length).toEqual(1); - expect($("svg #1 circle")[0].attributes.r.value).toEqual("8"); + expect($("svg #1 circle")[0].attributes.r.value).toEqual("25"); }); describe('testing for colours', function() {