equals(node) · Enzyme (original) (raw)

.equals(node) => Boolean

Returns whether or not the current wrapper root node render tree looks like the one passed in.

Arguments

  1. node (ReactElement): The node 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 it's render tree that looks like the one passed in.

Example

const wrapper = mount(<MyComponent />);
expect(wrapper.equals(<div className="foo bar" />)).to.equal(true);

Common Gotchas