MCPcopy Create free account
hub / github.com/angular/components / checkNodeContent

Function checkNodeContent

src/cdk/tree/tree.spec.ts:1693–1701  ·  view source on GitHub ↗
(node: Element, expectedNode: any[])

Source from the content-addressed store, hash-verified

1691function expectNestedTreeToMatch(treeElement: Element, ...expectedTree: any[]) {
1692 const missedExpectations: string[] = [];
1693 function checkNodeContent(node: Element, expectedNode: any[]) {
1694 const expectedTextContent = expectedNode[expectedNode.length - 1];
1695 const actualTextContent = node.childNodes.item(0).textContent!.trim();
1696 if (actualTextContent !== expectedTextContent) {
1697 missedExpectations.push(
1698 `Expected node contents to be ${expectedTextContent} but was ${actualTextContent}`,
1699 );
1700 }
1701 }
1702
1703 function checkNodeDescendants(node: Element, expectedNode: any[], currentIndex: number) {
1704 let expectedDescendant = 0;

Callers 1

expectNestedTreeToMatchFunction · 0.70

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected