rbardini / storybook-addon-paddings

🔲 A Storybook addon to add different paddings to your preview
https://storybook-addon-paddings.rbrd.in
MIT License
30 stars 2 forks source link

not compatible with storyshots? #3

Closed ldeveber closed 4 years ago

ldeveber commented 4 years ago

Hi! I was trying to add this to my project, and it seems to break all my jest unit tests. The output was extremely long so I just grabbed the tail end of the repeated stack trace:

Error: Uncaught [TypeError: reactPlatform_cjs.unstable_batchedUpdates is not a function]
    at reportException (./node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:66:24)
    at invokeEventListeners (./node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:209:9)
    at HTMLUnknownElementImpl._dispatch (./node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:119:9)
    at HTMLUnknownElementImpl.dispatchEvent (./node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:82:17)
    at HTMLUnknownElementImpl.dispatchEvent (./node_modules/jsdom/lib/jsdom/living/nodes/HTMLElement-impl.js:30:27)
    at HTMLUnknownElement.dispatchEvent (./node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:157:21)
    at Object.invokeGuardedCallbackDev (./node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10041:16)
    at invokeGuardedCallback (./node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10093:31)
    at commitRootImpl (./node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12989:9)
    at unstable_runWithPriority (./node_modules/scheduler/cjs/scheduler.development.js:653:12) TypeError: reactPlatform_cjs.unstable_batchedUpdates is not a function
    at batch (./node_modules/react-easy-state/src/scheduler.js:11:3)
    at HTMLUnknownElement.batched (./node_modules/react-easy-state/src/scheduler.js:26:14)
    at invokeEventListeners (./node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:193:27)
    at HTMLUnknownElementImpl._dispatch (./node_modules/jsdom/lib
 RUNS  tests/Storyshots.test.js
rbardini commented 4 years ago

Hi @ldeveber! Do you know if this problem happens with both storybook-addon-paddings@1.0.1 and storybook-addon-paddings@2.0.0? I suspect it's caused by the introduction of react-easy-state in https://github.com/rbardini/storybook-addon-paddings/pull/2/commits/149b1893ba1e200b0d04aee88a2f7dae69e4e677 to maintain the selected padding option between stories.

ldeveber commented 4 years ago

Hi @ldeveber! Do you know if this problem happens with both storybook-addon-paddings@1.0.1 and storybook-addon-paddings@2.0.0? I suspect it's caused by the introduction of react-easy-state in 149b189 to maintain the selected padding option between stories.

I don't know. I only just tried it last week and haven't gotten back to poking it again. I can try 1.0.1 tomorrow!

rbardini commented 4 years ago

Just released storybook-addon-paddings@2.0.2 with a complete rewrite of the paddings decorator. I'm not sure it fixes compatibility with StoryShots addon, but please give it a try if you have a chance and let me know how it goes 🙂