arnthor3 / react-bootstrap-toggle

Bootstrap-toggle without the JQuery dependencies
Other
54 stars 16 forks source link

Enzyme hangs when trying to mount a component with "ToggleButton" in it #17

Closed TAGC closed 7 years ago

TAGC commented 7 years ago

I found that one of my unit test suites caused my Jest test runner to hang indefinitely. I traced it down to trying to mount the component in the unit tests for that suite. I investigated further and found the issue was caused by using "ToggleButton" in the React component under test.

<span>
    <ToggleButton onstyle='danger' height='34px' active={true}/>
</span>

Which is imported with:

import ToggleButton from 'react-bootstrap-toggle';

Environment

arnthor3 commented 7 years ago

Could you try setting the width prop as well? The Toggle is trying to calculate the size of the component.

TAGC commented 7 years ago

Adding "width" allows the tests to run, yeah.