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

Function checkLevel

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

Source from the content-addressed store, hash-verified

1666 }
1667
1668 function checkLevel(node: Element, expectedNode: any[]) {
1669 const rawLevel = (node as HTMLElement).style.paddingLeft;
1670
1671 // Some browsers return 0, while others return 0px.
1672 const actualLevel = rawLevel === '0' ? '0px' : rawLevel;
1673 const expectedLevel = `${expectedNode.length * expectedPaddingIndent}${expectedPaddingUnits}`;
1674 if (actualLevel != expectedLevel) {
1675 missedExpectations.push(`Expected node level to be ${expectedLevel} but was ${actualLevel}`);
1676 }
1677 }
1678
1679 getNodes(treeElement).forEach((node, index) => {
1680 const expected = expectedTree ? expectedTree[index] : null;

Callers 1

expectFlatTreeToMatchFunction · 0.70

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected