store_node_test.js 513 B

1234567891011121314151617
  1. module('store node')
  2. test("get all children", function() {
  3. var node = new lunr.StoreNode,
  4. childNode = node.at('a'),
  5. otherChildNode = node.at('a'),
  6. grandChildNode = childNode.at('a')
  7. childNode.push('childNode')
  8. otherChildNode.push('otherChildNode')
  9. grandChildNode.push('grandChildNode')
  10. equal(node.allChildren().length, 3)
  11. ok(node.allChildren().indexOf(childNode) > -1)
  12. ok(node.allChildren().indexOf(otherChildNode) > -1)
  13. ok(node.allChildren().indexOf(grandChildNode) > -1)
  14. })