Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when i run mocha test using jsdom, get react-draggble error #123

Closed
pkumar84 opened this issue Jan 2, 2016 · 3 comments
Closed

when i run mocha test using jsdom, get react-draggble error #123

pkumar84 opened this issue Jan 2, 2016 · 3 comments

Comments

@pkumar84
Copy link

pkumar84 commented Jan 2, 2016

Dear Developers,

whenever i try to run mocha test i get below error,

ReferenceError: SVGElement is not defined
at Draggable.componentDidMount (node_modules/react-draggable/dist/react-draggable.js:199:63)
at CallbackQueue.assign.notifyAll (node_modules/react/lib/CallbackQueue.js:65:22)
at ReactReconcileTransaction.ON_DOM_READY_QUEUEING.close (node_modules/react/lib/ReactReconcileTransaction.js:81:26)
at ReactReconcileTransaction.Mixin.closeAll (node_modules/react/lib/Transaction.js:202:25)
at ReactReconcileTransaction.Mixin.perform (node_modules/react/lib/Transaction.js:149:16)
at batchedMountComponentIntoNode (node_modules/react/lib/ReactMount.js:282:15)
at ReactDefaultBatchingStrategyTransaction.Mixin.perform (node_modules/react/lib/Transaction.js:136:20)
at Object.ReactDefaultBatchingStrategy.batchedUpdates (node_modules/react/lib/ReactDefaultBatchingStrategy.js:62:19)
at Object.batchedUpdates (node_modules/react/lib/ReactUpdates.js:94:20)
at Object.ReactMount._renderNewRootComponent (node_modules/react/lib/ReactMount.js:476:18)
at Object.wrapper as _renderNewRootComponent
at Object.ReactMount._renderSubtreeIntoContainer (node_modules/react/lib/ReactMount.js:550:32)
at Object.ReactMount.render (node_modules/react/lib/ReactMount.js:570:23)
at Object.wrapper as render
at Object.ReactTestUtils.renderIntoDocument (node_modules/react/lib/ReactTestUtils.js:76:21)
at Context. (test/quickNoteTest.js:27:39)

Any thoughts ?

@everson
Copy link

everson commented May 10, 2016

@pkumar84 I am having the same problem. For now a workaround that made my tests pass again was adding global.SVGElement = function(){} after jsdom initialisation.

@STRML
Copy link
Collaborator

STRML commented May 10, 2016

Ah yes. We're doing a check against the global SVGElement type. I'll add a guard.

@STRML STRML closed this as completed in 1d532b7 May 10, 2016
@STRML
Copy link
Collaborator

STRML commented May 10, 2016

This is fixed in the v2.0.0 final release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants