castor icon indicating copy to clipboard operation
castor copied to clipboard

Make core stories work independently (iframe, canvas)

Open rabelloo opened this issue 3 years ago • 0 comments

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.

rabelloo avatar May 05 '21 11:05 rabelloo