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

Function getNodePredicate

src/material/tree/testing/node-harness.ts:81–104  ·  view source on GitHub ↗
(
  type: ComponentHarnessConstructor<T>,
  options: TreeNodeHarnessFilters,
)

Source from the content-addressed store, hash-verified

79}
80
81function getNodePredicate<T extends MatTreeNodeHarness>(
82 type: ComponentHarnessConstructor<T>,
83 options: TreeNodeHarnessFilters,
84): HarnessPredicate<T> {
85 return new HarnessPredicate(type, options)
86 .addOption('text', options.text, (harness, text) =>
87 HarnessPredicate.stringMatches(harness.getText(), text),
88 )
89 .addOption(
90 'disabled',
91 options.disabled,
92 async (harness, disabled) => (await harness.isDisabled()) === disabled,
93 )
94 .addOption(
95 'expanded',
96 options.expanded,
97 async (harness, expanded) => (await harness.isExpanded()) === expanded,
98 )
99 .addOption(
100 'level',
101 options.level,
102 async (harness, level) => (await harness.getLevel()) === level,
103 );
104}

Callers 1

withMethod · 0.85

Calls 6

addOptionMethod · 0.80
stringMatchesMethod · 0.80
isExpandedMethod · 0.65
getTextMethod · 0.45
isDisabledMethod · 0.45
getLevelMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…