A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://enzymejs.github.io/enzyme/docs/api/ShallowWrapper/containsAnyMatchingElements.html below:

containsAnyMatchingElements(nodes) ยท Enzyme

.containsAnyMatchingElements(patternNodes) => Boolean

Returns whether or not at least one of the given react elements in patternNodes matches an element in the wrapper's render tree. One or more elements of patternNodes must be matched one or more times. Matching follows the rules for containsMatchingElement.

Arguments
  1. patternNodes (Array<ReactElement>): The array of nodes whose presence you are detecting in the current instance's render tree.
Returns

Boolean: whether or not the current wrapper has a node anywhere in its render tree that looks like one of the array passed in.

Example
const style = { fontSize: 13 };
const wrapper = shallow((
  <div>
    <span className="foo">Hello</span>
    <div style={style}>Goodbye</div>
    <span>Again</span>
  </div>
));

expect(wrapper.containsAnyMatchingElements([
  <span>Bonjour</span>,
  <div>Goodbye</div>,
])).to.equal(true);
Common Gotchas

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4