You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting on with writing some tests, following this documentation and also this issue #453
The problem I have is regarding the test rendering.
I can get the example that the documentation gives working, wrapping the component in a DragDropContext and rendering it with TestUtils.renderIntoDocument.
This will return a DragDropContextContainer object.
However, if I try use the Enyzme mount method to render the object, it returns a $$typeof: Symbol(react.element) object - which won't let me get the manager.
I would prefer to use Enzyme - as that's what I'm using for my tests elsewhere.
Anyone got any help with this?
The text was updated successfully, but these errors were encountered:
I just got this working, here is what it looks like. in typescript.
import{ThingIAmTesting}from'../file/where/it/lives';describe('It is a test!',()=>{letprops;letcomponent;constgetComponent=()=>{letOriginalComponent=(ThingIAmTestingasany).DecoratedComponent;letidentity=el=>el;if(!component){component=Enzyme.shallow(<OriginalComponent{...props}connectDragSource={identity}/>);returncomponent}beforeEach(()=>{props={prop: 'stuff',}component=undefined;})it('should render',()=>{letcomponent=getComponent();expect(component).toMatchSnapshot();});})
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I'm getting on with writing some tests, following this documentation and also this issue #453
The problem I have is regarding the test rendering.
I can get the example that the documentation gives working, wrapping the component in a DragDropContext and rendering it with
TestUtils.renderIntoDocument
.This will return a
DragDropContextContainer
object.However, if I try use the Enyzme
mount
method to render the object, it returns a$$typeof: Symbol(react.element)
object - which won't let me get the manager.I would prefer to use Enzyme - as that's what I'm using for my tests elsewhere.
Anyone got any help with this?
The text was updated successfully, but these errors were encountered: