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

Function checkLevel

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

Source from the content-addressed store, hash-verified

1651 }
1652
1653 function checkLevel(node: Element, expectedNode: any[]) {
1654 const rawLevel = (node as HTMLElement).style.paddingLeft;
1655
1656 // Some browsers return 0, while others return 0px.
1657 const actualLevel = rawLevel === '0' ? '0px' : rawLevel;
1658 const expectedLevel = `${expectedNode.length * expectedPaddingIndent}${expectedPaddingUnits}`;
1659 if (actualLevel != expectedLevel) {
1660 missedExpectations.push(`Expected node level to be ${expectedLevel} but was ${actualLevel}`);
1661 }
1662 }
1663
1664 getNodes(treeElement).forEach((node, index) => {
1665 const expected = expectedTree ? expectedTree[index] : null;

Callers 1

expectFlatTreeToMatchFunction · 0.70

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected