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

No way to skip a story using CSF (Storybook 5.2) #176

Closed
tassoevan opened this issue Oct 3, 2019 · 1 comment · Fixed by #228
Closed

No way to skip a story using CSF (Storybook 5.2) #176

tassoevan opened this issue Oct 3, 2019 · 1 comment · Fixed by #228

Comments

@tassoevan
Copy link

tassoevan commented Oct 3, 2019

When writing stories using the CSF format, there is no way to mark a single story to be skipped. Ideally, a parameter would be neat:

export const componentVariation = () => <MyComponent prop1={val1} />;
componentVariation.story = {
  parameters: { skipLoki: true },
};
@JohnAlbin
Copy link

JohnAlbin commented Dec 21, 2019

Other addons to Storybook follow the pattern of exportedName.story.parameters.[addon name].[addon parameter]. https://storybook.js.org/docs/addons/writing-addons/#add-simple-metadata-using-parameters

For example:

myExportedStory.story = {
  parameters: {
    docs: {
      storyDescription: `This is the addon-docs way of adding data to its output.`,
    },
  },
};

So, Loki should do something similar:

export const componentVariation = () => <MyComponent prop1={val1} />;
componentVariation.story = {
  parameters: {
    loki: {
      skip: true,
    },
  },
};

Which means the storiesOf version would look like this:

storiesOf('SomeComponent', module)
  .add(
    'Component Variation',
    () => <MyComponent prop1={val1} />,
    {
      loki: { skip: true },
    }
  );

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

Successfully merging a pull request may close this issue.

2 participants