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
While using Jest + Enzyme/ReactTestRenderer, I encountered the two following errors:
Renderer:
TypeError: Cannot read property 'getElementsByTagName' of null
at MtSvgLines.selectPathElems (node_modules/react-mt-svg-lines/lib/index.js:282:36)
at MtSvgLines.getPathLengths (node_modules/react-mt-svg-lines/lib/index.js:373:28)
at MtSvgLines.animate (node_modules/react-mt-svg-lines/lib/index.js:229:34)
at MtSvgLines.componentDidMount (node_modules/react-mt-svg-lines/lib/index.js:96:12)
at node_modules/react-test-renderer/lib/ReactCompositeComponent.js:262:25
at measureLifeCyclePerf (node_modules/react-test-renderer/lib/ReactCompositeComponent.js:73:12)
at node_modules/react-test-renderer/lib/ReactCompositeComponent.js:261:11
at CallbackQueue.notifyAll (node_modules/react-test-renderer/lib/CallbackQueue.js:74:22)
at ReactTestReconcileTransaction.close (node_modules/react-test-renderer/lib/ReactTestReconcileTransaction.js:34:26)
at ReactTestReconcileTransaction.closeAll (node_modules/react-test-renderer/lib/Transaction.js:207:25)
at ReactTestReconcileTransaction.perform (node_modules/react-test-renderer/lib/Transaction.js:154:16)
at batchedMountComponentIntoNode (node_modules/react-test-renderer/lib/ReactTestMount.js:67:27)
at ReactDefaultBatchingStrategyTransaction.perform (node_modules/react-test-renderer/lib/Transaction.js:141:20)
at Object.batchedUpdates (node_modules/react-test-renderer/lib/ReactDefaultBatchingStrategy.js:60:26)
at Object.batchedUpdates (node_modules/react-test-renderer/lib/ReactUpdates.js:95:27)
at Object.render (node_modules/react-test-renderer/lib/ReactTestMount.js:126:18)
at Object.<anonymous> (tests/PageFooter.test.js:28:32)
TypeError: pathEl.getTotalLength is not a function
at node_modules/react-mt-svg-lines/lib/index.js:375:89
at Proxy.map (<anonymous>)
at MtSvgLines.getPathLengths (node_modules/react-mt-svg-lines/lib/index.js:374:21)
at MtSvgLines.animate (node_modules/react-mt-svg-lines/lib/index.js:229:34)
at MtSvgLines.componentDidMount (node_modules/react-mt-svg-lines/lib/index.js:96:12)
at node_modules/react-dom/lib/ReactCompositeComponent.js:262:25
at measureLifeCyclePerf (node_modules/react-dom/lib/ReactCompositeComponent.js:73:12)
at node_modules/react-dom/lib/ReactCompositeComponent.js:261:11
at CallbackQueue.notifyAll (node_modules/react-dom/lib/CallbackQueue.js:74:22)
at ReactReconcileTransaction.close (node_modules/react-dom/lib/ReactReconcileTransaction.js:78:26)
at ReactReconcileTransaction.closeAll (node_modules/react-dom/lib/Transaction.js:207:25)
at ReactReconcileTransaction.perform (node_modules/react-dom/lib/Transaction.js:154:16)
at batchedMountComponentIntoNode (node_modules/react-dom/lib/ReactMount.js:124:15)
at ReactDefaultBatchingStrategyTransaction.perform (node_modules/react-dom/lib/Transaction.js:141:20)
at Object.batchedUpdates (node_modules/react-dom/lib/ReactDefaultBatchingStrategy.js:60:26)
at Object.batchedUpdates (node_modules/react-dom/lib/ReactUpdates.js:95:27)
at Object._renderNewRootComponent (node_modules/react-dom/lib/ReactMount.js:317:18)
at Object._renderSubtreeIntoContainer (node_modules/react-dom/lib/ReactMount.js:399:32)
at Object.render (node_modules/react-dom/lib/ReactMount.js:420:23)
at Object.render (node_modules/enzyme-adapter-react-15/build/ReactFifteenAdapter.js:181:50)
at new ReactWrapper (node_modules/enzyme/build/ReactWrapper.js:98:16)
at mount (node_modules/enzyme/build/mount.js:19:10)
at Object.<anonymous> (tests/PageFooter.test.js:22:14)
I'm using react-mt-svg-lines 0.8.4, and right now I'm working around this issue by safely accessing getElementsByTagName through this change to line 282 in index.js: var svgEl = this._svgWrapper && this._svgWrapper.getElementsByTagName('svg')[0];
The text was updated successfully, but these errors were encountered:
k, don't have a quick way to test it with Enzyme/ReactTestRenderer but your guard looks good. implemented in 0.8.5. will need to make a larger update for React 17 soon, so perhaps will find some time to add Jest/Enzyme then..
While using Jest + Enzyme/ReactTestRenderer, I encountered the two following errors:
Renderer:
Enzyme (same as #11 ):
I'm using react-mt-svg-lines 0.8.4, and right now I'm working around this issue by safely accessing getElementsByTagName through this change to line 282 in
index.js
:var svgEl = this._svgWrapper && this._svgWrapper.getElementsByTagName('svg')[0];
The text was updated successfully, but these errors were encountered: