setState in componentDidMount, enzyme tests failing
my cDM looks like the following
cDM() {
//check if browser supports a feature
//if yes then setState to denote it is supported
this.setState( { supports: true });
}
render() {
if(this.state.supports) // show button;
else // show "not supported" message
}
The "this.setState" call in cDM is making the enzyme "mount" to fail. Any ideas how to fix this? Or is there another way i can achieve it (instead of using state )