Returns the wrapped ReactElement.
If the current wrapper is wrapping the root component, returns the root component's latest render output.
ReactElement: The retrieved ReactElement.
const element = (
<div>
<span />
<span />
</div>
);
function MyComponent() {
return element;
}
const wrapper = shallow(<MyComponent />);
expect(wrapper.getElement()).to.equal(element);
© 2015 Airbnb, Inc.
Licensed under the MIT License.
https://airbnb.io/enzyme/docs/api/ShallowWrapper/getElement.html