#tree_util.buildTrees  ✓ missing param objectArray should throw exception  ✓ missing param config should throw exception  ✓ config has not id property set, should throw exception  ✓ config has not parentid property set, should throw exception  ✓ empty input aray returns empty array of trees  ✓ aray with one object should return an array containing one tree  ✓ aray with one root and one child node should return an array containing one tree  ✓ config of tree should be the same as parameter config  ✓ aray with one root and one child node should return one tree where root has one child node  ✓ aray with one root and one child node should return one tree where single child node has root as parent  ✓ aray with one root which has tree child nodee should return one tree where root has tree children  ✓ aray with one root which has tree child nodee should return one tree where each child as root as parent  ✓ aray with one root which has more complex structure should have the property parent set correct for all nodes  ✓ aray with one root which has more complex structure should have child count for each node as expected  ✓ aray with two root which has more complex structure should have child count for each node as expected  #tree.getNodeById  ✓ will return an item with the expected id  #tree.addData  ✓ addData is called with mising objectArray param and exception is thrown  ✓ addData is called with mising config param and exception is thrown  ✓ addData is called and data is added to the right nodes  ✓ addData is called with the same data as in the example in the readme file  #node.getSingleNodeData  ✓ for the given node returns a collection with 2 items (they come from same collection)  ✓ for given node returns a collection with 3 items (they come from two collections)  #node.getRecursiveNodeData  ✓ for the root node returns a collection with 6 items (they come from 4 different nodes)  ✓ for the root node returns a collection with 2 items due to usage of filter function  ✓ for the root node returns a collection with 2 items due to usage of filter function  ✓ for each leaf node in the tree getSingleNodeData and getRecursiveNodeData should return same data  #node.getRecursiveCollection  ✓ for the root node returns the same data as input for tree.addData)  ✓ for the root node returns the same data as input for tree.addData (with different data then previous))  #node.getDescendants  ✓ for the root node returns an array where length is equal to items count - 1 (the root)  #node.getAncestors  ✓ for all descendant nodes of the root node will have the root among its ancestors  #node.isDescendantOf  ✓ all root descendants should return true when they call isDescendantOf with root node as param  ✓ example from readme file  #node.isAncestorOf  ✓ all root descendants should return true when they are used as input param for method isAncestorOf on root node  ✓ example from readme file  #node.isLeaf  ✓ should return true when node is a leaf node  ✓ should return true when node is not a leaf node  #node.removeAllDescendants  ✓ should return 0 for length for children property after function call on node with child nodes  ✓ should return 0 for length for children property after function call on node with no child nodes  ✓ all child nodes should have parent set to null after function call  #node.removeParent  ✓ should return null for parent property  ✓ parent should not contain node in children array  #tree.createNode  ✓ creates a node based on object data which complies with the tree config  ✓ creates a node which can be found by getNodeById  ✓ creates a node based and it will be a child of the expected parent node  ✓ tries creates a node based on object data where no parent can be found, throws error  #node.removeChild  ✓ removes a child node from a node   46 passing (17ms)