Skip to content

Commit

Permalink
Added test for disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeasday committed Jul 1, 2022
1 parent f945b4b commit 814885f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
5 changes: 0 additions & 5 deletions examples/react-ts/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ const config: StorybookConfig = {
'@storybook/addon-storyshots',
'@storybook/addon-a11y',
],
docs: {
// enabled: false,
defaultName: 'Info',
// docsPage: false,
},
typescript: {
check: true,
checkOptions: {},
Expand Down
25 changes: 25 additions & 0 deletions lib/core-server/src/utils/StoryIndexGenerator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,31 @@ describe('StoryIndexGenerator', () => {
);
});

it('generates no docs entries when docs are disabled', async () => {
const generator = new StoryIndexGenerator([storiesSpecifier, docsSpecifier], {
...options,
docs: {
...options.docs,
enabled: false,
},
});
await generator.initialize();

expect(await generator.getIndex()).toMatchInlineSnapshot(`
Object {
"entries": Object {
"a--story-one": Object {
"id": "a--story-one",
"importPath": "./src/A.stories.js",
"name": "Story One",
"title": "A",
"type": "story",
},
},
"v": 4,
}
`);
});
it('Allows you to override default name for docs files', async () => {
const generator = new StoryIndexGenerator([storiesSpecifier, docsSpecifier], {
...options,
Expand Down

0 comments on commit 814885f

Please sign in to comment.