Skip to content

Commit

Permalink
Merge pull request #206 from storybookjs/fix-ignored-tags
Browse files Browse the repository at this point in the history
v5: Fix tags being ignored
  • Loading branch information
JReinhold authored Aug 27, 2024
2 parents 01768c8 + e4feeae commit e0ebaf4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/indexer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const indexer: Indexer = {
exportName,
name,
title: metaTitle,
tags: combineTags(...metaTags, ...tags),
tags: [...metaTags, ...tags],
} satisfies IndexInput;
});
},
Expand Down
25 changes: 25 additions & 0 deletions tests/stories/Tags.stories.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<script context="module">
import { defineMeta } from '@storybook/addon-svelte-csf';
/**
* Testing tags parsing in the addon's indexer.
* - In the sidebar, only the _"With Dev"_ story should be visible.
* - In docs, only the _"With Autodocs"_ story should be visible.
*/
const { Story } = defineMeta({
title: 'Tags',
parameters: {
controls: { disable: true },
},
tags: ['!dev', '!autodocs', '!test'],
});
</script>


<Story name="With Autodocs" tags={['autodocs']}>With autodocs</Story>

<Story name="With Dev" tags={['dev']}>With dev</Story>

<Story name="With Test" tags={['test']}>With test</Story>

<Story name="No Tags">No tags</Story>

0 comments on commit e0ebaf4

Please sign in to comment.