Skip to content

Latest commit

 

History

History
37 lines (22 loc) · 607 Bytes

getElements.md

File metadata and controls

37 lines (22 loc) · 607 Bytes

.getElements() => Array<ReactElement>

Returns the wrapped ReactElements

If the current wrapper is wrapping the root component, returns the root component's latest render output wrapped in an array.

Returns

Array<ReactElement>: The retrieved ReactElements.

Examples

const one = <span />;
const two = <span />;

function Test() {
  return (
    <div>
      {one}
      {two}
    </div>
  );
}

const wrapper = mount(<Test />);
expect(wrapper.find('span').getElements()).to.deep.equal([one, two]);

Related Methods