From 7c38894cee18f2acefa9b02c99d7dec4fb1b1e3b Mon Sep 17 00:00:00 2001 From: Michael Hackstein Date: Fri, 15 Mar 2013 14:51:30 +0100 Subject: [PATCH] Added check for thrown errors on setup for ExpandEvent to spec --- .../specEventLibrary/eventLibrarySpec.js | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/frontend/js/graphViewer/jasmine_test/specEventLibrary/eventLibrarySpec.js b/frontend/js/graphViewer/jasmine_test/specEventLibrary/eventLibrarySpec.js index dbe3106628..1cb2e66129 100644 --- a/frontend/js/graphViewer/jasmine_test/specEventLibrary/eventLibrarySpec.js +++ b/frontend/js/graphViewer/jasmine_test/specEventLibrary/eventLibrarySpec.js @@ -172,6 +172,50 @@ expect(reshapedNodes[0]).toEqual(root); }); + describe('setup process', function() { + + it('should throw an error if edges are not given', function() { + expect( + function() { + eventLib.Expand(); + } + ).toThrow("Edges have to be defined"); + }); + + it('should throw an error if nodes are not given', function() { + expect( + function() { + eventLib.Expand([]); + } + ).toThrow("Nodes have to be defined"); + }); + + it('should throw an error if start callback is not given', function() { + expect( + function() { + eventLib.Expand([], []); + } + ).toThrow("A callback to the Start-method has to be defined"); + }); + + it('should throw an error if load node callback is not given', function() { + expect( + function() { + eventLib.Expand([], [], function(){}); + } + ).toThrow("A callback to load a node has to be defined"); + }); + + it('should throw an error if reshape node callback is not given', function() { + expect( + function() { + eventLib.Expand([], [], function(){}, function(){}); + } + ).toThrow("A callback to reshape a node has to be defined"); + }); + + }); + }); });