castor
castor copied to clipboard
Make core stories work independently (iframe, canvas)
Currently core stories (that render HTML as a React component, kinda hacky) do not work as Canvas or iFrames:
- https://onfido.github.io/castor/?path=/story/core-button--playground
- https://onfido.github.io/castor/iframe.html?id=core-button--playground&viewMode=story
Which means that Visual Regression tests for core stories take screenshots of rendered text, and not the component.
The current approach relies on Storybook Docs' prepareForInline
which is not used for both cases described above.
The solution would have to work across all three.
We can probably shift the "html to react" transformer into the html helper.
Also, docs' "Show code" preview needs to continue to work, so the suggestion above might not work.