Jest snapshot testing
See original GitHub issueI see an error while trying to write a snapshot test.
TypeError: Cannot read property 'selectionEnd' of null
at Object.updateValueState (node_modules/season-web-components/node_modules/cleave.js/dist/cleave-react.js:423:36) at Object.onInput (node_modules/season-web-components/node_modules/cleave.js/dist/cleave-react.js:366:16) at Object.init (node_modules/season-web-components/node_modules/cleave.js/dist/cleave-react.js:164:16) at Object.componentDidMount (node_modules/season-web-components/node_modules/cleave.js/dist/cleave-react.js:75:15) at Object.chainedFunction [as componentDidMount] (node_modules/season-web-components/node_modules/cleave.js/dist/cleave-react.js:1147: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 [as create] (node_modules/react-test-renderer/lib/ReactTestMount.js:126:18)
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
I can second this. I’m getting this same error with react.
Hi @joelmoss @pedrolauro it was fixed here in May, thanks. https://github.com/nosir/cleave.js/pull/461