Open Marlinxx opened 1 month ago
I create the react components form .glb files using gltfjsx package. And I make some changes like adding event handlers and adding refs. The React component works fine in dev environment. But cannot render the component from unit testing.
Test case:
test("render" , async () => { const mechClickHandler = jest.fn(); const props = { position: new Vector3(0, 0, 0), slotNumber: 1, cardName: "HCPSLine22", onMeshClick: mechClickHandler, ports: cardData.ports, cardType: "HCPSLine22", card: cardData, expanded: false, ejected: false, }; render(<HCPSLine22 {...props} />) })
And Im facing below issue, TypeError: Cannot destructure property 'nodes' of '(0 , _drei.useGLTF)(...)' as it is undefined.
Aim: I looking to test the events fired from component
Can someone help here?
I create the react components form .glb files using gltfjsx package. And I make some changes like adding event handlers and adding refs. The React component works fine in dev environment. But cannot render the component from unit testing.
Test case:
And Im facing below issue, TypeError: Cannot destructure property 'nodes' of '(0 , _drei.useGLTF)(...)' as it is undefined.
Aim: I looking to test the events fired from component
Can someone help here?