Closed jayce1996 closed 2 years ago
Fix available in v2.x.x. Reopen it, if doesnt woork
@srigar I'm still getting this error with version 2.0.25 and jest
/**
* @jest-environment jsdom
*/
import renderer from 'react-test-renderer';
import { Multiselect } from 'multiselect-react-dropdown';
it('multiselect renders', () => {
let state = {
options: [{name: 'Option 1', id: 1},{name: 'Option 2', id: 2}]
};
const tree = renderer
.create(<Multiselect
options={state.options} // Options to display in the dropdown
displayValue="name" // Property name to display in the dropdown options
/>
)
.toJSON();
expect(tree).toMatchSnapshot();
});
Any help would be much appreciated. The component itself works great with some nice fixes being observed after we upgraded from 1.6 to 2.0.25 :-)
Whilst my code executes both in the react dev environment, and in a live build, for some bizarre reason I get this error when running jest tests, even the simplest components that contain nothing other than a div and then a bare bones implementation of multiselect-react-dropdown will throw this error when trying to create a jest snapshot.
the following errors are observed: TypeError: Cannot read property 'addEventListener' of null