mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-31 05:03:21 +08:00
Fix test CSF test
This commit is contained in:
parent
87aec075e0
commit
1f68045082
@ -76,7 +76,7 @@ describe('core.preview.loadCsf', () => {
|
||||
2: Object.assign(() => 0, { storyName: 'two' }),
|
||||
},
|
||||
};
|
||||
configure(makeRequireContext(input), mod, 'react');
|
||||
configure('react', makeRequireContext(input), mod);
|
||||
|
||||
const mockedStoriesOf = clientApi.storiesOf as jest.Mock;
|
||||
expect(mockedStoriesOf).toHaveBeenCalledWith('a', true);
|
||||
@ -106,7 +106,7 @@ describe('core.preview.loadCsf', () => {
|
||||
__namedExportsOrder: ['w', 'x', 'z', 'y'],
|
||||
},
|
||||
};
|
||||
configure(makeRequireContext(input), mod, 'react');
|
||||
configure('react', makeRequireContext(input), mod);
|
||||
|
||||
const mockedStoriesOf = clientApi.storiesOf as jest.Mock;
|
||||
const aApi = mockedStoriesOf.mock.results[0].value;
|
||||
@ -129,7 +129,7 @@ describe('core.preview.loadCsf', () => {
|
||||
w: () => 0,
|
||||
},
|
||||
};
|
||||
configure(makeRequireContext(input), mod, 'react');
|
||||
configure('react', makeRequireContext(input), mod);
|
||||
|
||||
const mockedStoriesOf = clientApi.storiesOf as jest.Mock;
|
||||
const aApi = mockedStoriesOf.mock.results[0].value;
|
||||
@ -151,7 +151,7 @@ describe('core.preview.loadCsf', () => {
|
||||
w: () => 0,
|
||||
},
|
||||
};
|
||||
configure(makeRequireContext(input), mod, 'react');
|
||||
configure('react', makeRequireContext(input), mod);
|
||||
|
||||
const mockedStoriesOf = clientApi.storiesOf as jest.Mock;
|
||||
const aApi = mockedStoriesOf.mock.results[0].value;
|
||||
@ -170,7 +170,7 @@ describe('core.preview.loadCsf', () => {
|
||||
x: () => 0,
|
||||
},
|
||||
};
|
||||
configure(makeRequireContext(input), mod, 'react');
|
||||
configure('react', makeRequireContext(input), mod);
|
||||
|
||||
const mockedStoriesOf = clientApi.storiesOf as jest.Mock;
|
||||
const aApi = mockedStoriesOf.mock.results[0].value;
|
||||
@ -189,7 +189,7 @@ describe('core.preview.loadCsf', () => {
|
||||
},
|
||||
},
|
||||
};
|
||||
configure(makeRequireContext(input), mod, 'react');
|
||||
configure('react', makeRequireContext(input), mod);
|
||||
|
||||
const mockedStoriesOf = clientApi.storiesOf as jest.Mock;
|
||||
const aApi = mockedStoriesOf.mock.results[0].value;
|
||||
@ -217,7 +217,7 @@ describe('core.preview.loadCsf', () => {
|
||||
x: () => 0,
|
||||
},
|
||||
};
|
||||
configure(makeRequireContext(input), mod, 'react');
|
||||
configure('react', makeRequireContext(input), mod);
|
||||
|
||||
const mockedStoriesOf = clientApi.storiesOf as jest.Mock;
|
||||
const aApi = mockedStoriesOf.mock.results[0].value;
|
||||
@ -247,7 +247,7 @@ describe('core.preview.loadCsf', () => {
|
||||
}),
|
||||
},
|
||||
};
|
||||
configure(makeRequireContext(input), mod, 'react');
|
||||
configure('react', makeRequireContext(input), mod);
|
||||
|
||||
const mockedStoriesOf = clientApi.storiesOf as jest.Mock;
|
||||
const aApi = mockedStoriesOf.mock.results[0].value;
|
||||
@ -278,7 +278,7 @@ describe('core.preview.loadCsf', () => {
|
||||
}),
|
||||
},
|
||||
};
|
||||
configure(makeRequireContext(input), mod, 'react');
|
||||
configure('react', makeRequireContext(input), mod);
|
||||
|
||||
const mockedStoriesOf = clientApi.storiesOf as jest.Mock;
|
||||
const aApi = mockedStoriesOf.mock.results[0].value;
|
||||
@ -303,7 +303,7 @@ describe('core.preview.loadCsf', () => {
|
||||
x: () => 0,
|
||||
},
|
||||
};
|
||||
configure(makeRequireContext(firstInput), mod, 'react');
|
||||
configure('react', makeRequireContext(firstInput), mod);
|
||||
|
||||
// HMR dispose callbacks
|
||||
doHMRDispose();
|
||||
@ -319,7 +319,7 @@ describe('core.preview.loadCsf', () => {
|
||||
x: () => 0,
|
||||
},
|
||||
};
|
||||
configure(makeRequireContext(secondInput), mod, 'react');
|
||||
configure('react', makeRequireContext(secondInput), mod);
|
||||
|
||||
expect(storyStore.removeStoryKind).not.toHaveBeenCalled();
|
||||
expect(mockedStoriesOf).toHaveBeenCalledWith('b', true);
|
||||
@ -342,7 +342,7 @@ describe('core.preview.loadCsf', () => {
|
||||
x: () => 0,
|
||||
},
|
||||
};
|
||||
configure(makeRequireContext(firstInput), mod, 'react');
|
||||
configure('react', makeRequireContext(firstInput), mod);
|
||||
|
||||
// HMR dispose callbacks
|
||||
doHMRDispose();
|
||||
@ -352,7 +352,7 @@ describe('core.preview.loadCsf', () => {
|
||||
const secondInput = {
|
||||
a: firstInput.a,
|
||||
};
|
||||
configure(makeRequireContext(secondInput), mod, 'react');
|
||||
configure('react', makeRequireContext(secondInput), mod);
|
||||
|
||||
expect(storyStore.removeStoryKind).toHaveBeenCalledWith('b');
|
||||
expect(mockedStoriesOf).not.toHaveBeenCalled();
|
||||
@ -376,7 +376,7 @@ describe('core.preview.loadCsf', () => {
|
||||
x: () => 0,
|
||||
},
|
||||
};
|
||||
configure(makeRequireContext(firstInput), mod, 'react');
|
||||
configure('react', makeRequireContext(firstInput), mod);
|
||||
|
||||
// HMR dispose callbacks
|
||||
doHMRDispose();
|
||||
@ -393,7 +393,7 @@ describe('core.preview.loadCsf', () => {
|
||||
y: () => 0,
|
||||
},
|
||||
};
|
||||
configure(makeRequireContext(secondInput), mod, 'react');
|
||||
configure('react', makeRequireContext(secondInput), mod);
|
||||
|
||||
expect(storyStore.removeStoryKind).toHaveBeenCalledTimes(1);
|
||||
expect(storyStore.removeStoryKind).toHaveBeenCalledWith('a');
|
||||
@ -411,7 +411,7 @@ describe('core.preview.loadCsf', () => {
|
||||
// no named exports, will not present a story
|
||||
},
|
||||
};
|
||||
configure(makeRequireContext(input), mod, 'react');
|
||||
configure('react', makeRequireContext(input), mod);
|
||||
expect(logger.warn).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@ -426,7 +426,7 @@ describe('core.preview.loadCsf', () => {
|
||||
x: () => 0,
|
||||
},
|
||||
};
|
||||
configure(makeRequireContext(input), mod, 'react');
|
||||
configure('react', makeRequireContext(input), mod);
|
||||
expect(logger.warn).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user