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

Function checkLevel

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

Source from the content-addressed store, hash-verified

1367 }
1368
1369 function checkLevel(node: Element, expectedNode: any[]) {
1370 const rawLevel = (node as HTMLElement).style.paddingLeft;
1371
1372 // Some browsers return 0, while others return 0px.
1373 const actualLevel = rawLevel === '0' ? '0px' : rawLevel;
1374 const expectedLevel = `${expectedNode.length * expectedPaddingIndent}${expectedPaddingUnits}`;
1375 if (actualLevel != expectedLevel) {
1376 missedExpectations.push(`Expected node level to be ${expectedLevel} but was ${actualLevel}`);
1377 }
1378 }
1379
1380 getNodes(treeElement).forEach((node, index) => {
1381 const expected = expectedTree ? expectedTree[index] : null;

Callers 1

expectFlatTreeToMatchFunction · 0.70

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…