1
0
Fork 0

Added check for thrown errors on setup for ExpandEvent to spec

This commit is contained in:
Michael Hackstein 2013-03-15 14:51:30 +01:00
parent 8d291b29c1
commit 7c38894cee
1 changed files with 44 additions and 0 deletions

View File

@ -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");
});
});
});
});