MCPcopy Index your code
hub / github.com/angular/components / checkNodeDescendants

Function checkNodeDescendants

src/cdk/tree/tree-with-tree-control.spec.ts:1404–1421  ·  view source on GitHub ↗
(node: Element, expectedNode: any[], currentIndex: number)

Source from the content-addressed store, hash-verified

1402 }
1403
1404 function checkNodeDescendants(node: Element, expectedNode: any[], currentIndex: number) {
1405 let expectedDescendant = 0;
1406
1407 for (let i = currentIndex + 1; i < expectedTree.length; ++i) {
1408 if (expectedTree[i].length > expectedNode.length) {
1409 ++expectedDescendant;
1410 } else if (expectedTree[i].length === expectedNode.length) {
1411 break;
1412 }
1413 }
1414
1415 const actualDescendant = getNodes(node).length;
1416 if (actualDescendant !== expectedDescendant) {
1417 missedExpectations.push(
1418 `Expected node descendant num to be ${expectedDescendant} but was ${actualDescendant}`,
1419 );
1420 }
1421 }
1422
1423 getNodes(treeElement).forEach((node, index) => {
1424 const expected = expectedTree ? expectedTree[index] : null;

Callers 1

expectNestedTreeToMatchFunction · 0.70

Calls 2

getNodesFunction · 0.70
pushMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…