mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-31 05:03:21 +08:00
Enfore type
on StoryIndex
in preview
This commit is contained in:
parent
32f2ffbdb2
commit
dffce1ec29
@ -52,7 +52,7 @@ beforeEach(() => {
|
||||
projectAnnotations.renderToDOM.mockReset();
|
||||
projectAnnotations.render.mockClear();
|
||||
projectAnnotations.decorators[0].mockClear();
|
||||
projectAnnotations.parameters.docs.renderer = () => new DocsRenderer();
|
||||
projectAnnotations.parameters.docs.renderer = () => new DocsRenderer() as any;
|
||||
|
||||
addons.setChannel(mockChannel as any);
|
||||
addons.setServerChannel(createMockChannel());
|
||||
|
@ -55,18 +55,21 @@ export const storyIndex: StoryIndex = {
|
||||
v: 4,
|
||||
entries: {
|
||||
'component-one--a': {
|
||||
type: 'story',
|
||||
id: 'component-one--a',
|
||||
title: 'Component One',
|
||||
name: 'A',
|
||||
importPath: './src/ComponentOne.stories.js',
|
||||
},
|
||||
'component-one--b': {
|
||||
type: 'story',
|
||||
id: 'component-one--b',
|
||||
title: 'Component One',
|
||||
name: 'B',
|
||||
importPath: './src/ComponentOne.stories.js',
|
||||
},
|
||||
'component-two--c': {
|
||||
type: 'story',
|
||||
id: 'component-two--c',
|
||||
title: 'Component Two',
|
||||
name: 'C',
|
||||
|
@ -286,6 +286,7 @@ describe('PreviewWeb', () => {
|
||||
entries: {
|
||||
...storyIndex.entries,
|
||||
'component-one--d': {
|
||||
type: 'story',
|
||||
id: 'component-one--d',
|
||||
title: 'Component One',
|
||||
name: 'D',
|
||||
@ -336,6 +337,7 @@ describe('PreviewWeb', () => {
|
||||
entries: {
|
||||
...storyIndex.entries,
|
||||
'component-one--d': {
|
||||
type: 'story',
|
||||
id: 'component-one--d',
|
||||
title: 'Component One',
|
||||
name: 'D',
|
||||
|
@ -46,18 +46,21 @@ const storyIndex: StoryIndex = {
|
||||
v: 4,
|
||||
entries: {
|
||||
'component-one--a': {
|
||||
type: 'story',
|
||||
id: 'component-one--a',
|
||||
title: 'Component One',
|
||||
name: 'A',
|
||||
importPath: './src/ComponentOne.stories.js',
|
||||
},
|
||||
'component-one--b': {
|
||||
type: 'story',
|
||||
id: 'component-one--b',
|
||||
title: 'Component One',
|
||||
name: 'B',
|
||||
importPath: './src/ComponentOne.stories.js',
|
||||
},
|
||||
'component-two--c': {
|
||||
type: 'story',
|
||||
id: 'component-two--c',
|
||||
title: 'Component Two',
|
||||
name: 'C',
|
||||
@ -235,6 +238,7 @@ describe('StoryStore', () => {
|
||||
entries: {
|
||||
...storyIndex.entries,
|
||||
'new-component--story': {
|
||||
type: 'story',
|
||||
id: 'new-component--story',
|
||||
title: 'New Component',
|
||||
name: 'Story',
|
||||
@ -266,6 +270,7 @@ describe('StoryStore', () => {
|
||||
v: 4,
|
||||
entries: {
|
||||
'component-one--a': {
|
||||
type: 'story',
|
||||
id: 'component-one--a',
|
||||
title: 'Component One',
|
||||
name: 'A',
|
||||
@ -296,6 +301,7 @@ describe('StoryStore', () => {
|
||||
v: 4,
|
||||
entries: {
|
||||
'component-one--a': {
|
||||
type: 'story',
|
||||
id: 'component-one--a',
|
||||
title: 'Component One',
|
||||
name: 'A',
|
||||
|
@ -98,7 +98,7 @@ interface BaseIndexEntry {
|
||||
importPath: Path;
|
||||
}
|
||||
export type StoryIndexEntry = BaseIndexEntry & {
|
||||
type?: 'story';
|
||||
type: 'story';
|
||||
};
|
||||
|
||||
export type DocsIndexEntry = BaseIndexEntry & {
|
||||
|
Loading…
x
Reference in New Issue
Block a user