loki
loki copied to clipboard
Problems caused by skip() & lokiSkip(): they break other storybook plugins
lokiSkip()
and asyc
are pretty handy functions, but they break other storybook plugins:
e.g. the storyshots plugin, which complains, that lokiSkip
isn't a function.
this happens because loki just registers this functions when it is configuring storybook.
All other plugins, don't use the loki config-storybook
and will therefor break.
Please find another possibility to add this functions (just register a normal storybook plugin?) or keep the cli option to exclude stories.
I'm not sure is it related, but I also faced problem while passing @storybook/addon-viewport
parameters to .lokiSkip
.
Example:
storiesOf('Card', module)
.add('default', () => (
<Card />
))
.lokiSkip('iphone6', () => (
<Card />
), { viewport: { defaultViewport: 'iphone6' }})
Parameters are not recognized and both use the same viewport. But using .add
instead of .lokiSkip
works as expected and sets viewport according to parameters.
Any update there?
I have the same problem. Are there any updates?
Setup
Node v12.16.2
Loki v0.22.1
Storybook v5.3.13
Storybook addons: docs
, viewport
Example
storiesOf('Card', module)
.addParameters({ component: Card })
.add('default', () => (
<Card />
))
.lokiSkip('default2', () => (
<Card />
))
What do I expect?
If I start storybook there should be two stories. If I go to the Docs tab in storybook there should be the documentation of all two stories, including the props list of the component on top and the code of each story visible next to each rendered story.
Cod button example in right bottom corner:
What is really happening?
I can not see the code from the default2
story, but I can from the default
story.
Code button:
Suggestions
This looks like lokiSkip
prevents some functionality of the add-ons.
It should be possible to pass the whole add
function through the lokiSkip
to prevent