diff --git a/html/admin/js/graphViewer/graph/abstractAdapter.js b/html/admin/js/graphViewer/graph/abstractAdapter.js
index 670e174b1b..480a24aeb9 100644
--- a/html/admin/js/graphViewer/graph/abstractAdapter.js
+++ b/html/admin/js/graphViewer/graph/abstractAdapter.js
@@ -307,6 +307,7 @@ function AbstractAdapter(nodes, edges, descendant) {
});
commNode.x = nodesToRemove[0].x;
commNode.y = nodesToRemove[0].y;
+ commNode._size = community.length;
cachedCommunities[commId] = {};
cachedCommunities[commId].nodes = nodesToRemove;
cachedCommunities[commId].edges = [];
diff --git a/html/admin/js/graphViewer/jasmine_test/specAdapter/abstractAdapterSpec.js b/html/admin/js/graphViewer/jasmine_test/specAdapter/abstractAdapterSpec.js
index 1c389f6027..cfd4336ff2 100644
--- a/html/admin/js/graphViewer/jasmine_test/specAdapter/abstractAdapterSpec.js
+++ b/html/admin/js/graphViewer/jasmine_test/specAdapter/abstractAdapterSpec.js
@@ -844,6 +844,28 @@
existNode(3);
});
+ it('should create proper attributes for the community', function() {
+ var n1, n2, n3, n4, n5, com;
+ spyOn(mockWrapper, "call").andCallFake(function(name) {
+ workerCB({
+ data: {
+ cmd: name,
+ result: [1, 2, 3, 4, 5]
+ }
+ });
+ });
+ n1 = adapter.insertNode({_id: 1});
+ n2 = adapter.insertNode({_id: 2});
+ n3 = adapter.insertNode({_id: 3});
+ n4 = adapter.insertNode({_id: 4});
+ n5 = adapter.insertNode({_id: 5});
+ adapter.setNodeLimit(2);
+ com = getCommunityNodes()[0];
+ expect(com.x).toBeDefined();
+ expect(com.y).toBeDefined();
+ expect(com._size).toEqual(5);
+ });
+
it('should not trigger getCommunity multiple times', function() {
spyOn(mockWrapper, "call").andCallFake(function(name) {
setTimeout(function() {
@@ -1526,8 +1548,6 @@
});
-
-
describe('checking many child nodes', function() {
var adapter, mockReducer;