How to test the components, which are described using arrow functions?

Hello!
The problem is this: described component through a function pointer
const Form = (props) => {
the <div>
 <button onclick="{()" => func1}>Component Button 1</button>
 <button onclick="{()" => func2}>Component Button 2</button>
</div>
}

such an example is the pseudocode.

and wrote on the case tests (TestUtils, Karma, Jasmine), which would verify that clicking on the first button would invoke func1, the second func2.

but on this spot the problem:
const instance = TestUtils.renderIntoDocument(
);
I get not React.Component (which is logical, I do not inherit from it), and NULL!!
I can not understand and find out what other methods and tools can be tested??
July 4th 19 at 22:51
1 answer
July 4th 19 at 22:53
Solution
Found the solution and it was simple.

For testing such a component can create a component TestWrapper
import React {Component PropTypes} from 'react';

export default class TestWrapper extends Component {
 constructor(props) {
super(props);
}

 render() {
 return React.Children.only is(this.props.children);
}
}

TestWrapper.propTypes = {
 children: PropTypes.node.isRequired
}


and to wrap it my "arrow component"
const instance = TestUtils.renderIntoDocument(<testwrapper></testwrapper>
);

Find more questions by tags JavaScriptReactDevelopment through testing