Fix tests

(The order of `SET_STORIES` and `STORY_RENDERED` swapped)
This commit is contained in:
Tom Coleman 2021-10-14 15:11:44 +11:00
parent f8d993677c
commit a02b2c7f4c

View File

@ -62,7 +62,7 @@ describe('start', () => {
.add('Story Three', jest.fn());
});
await waitForEvents([Events.SET_STORIES]);
await waitForRender();
expect(
mockChannel.emit.mock.calls.find((call: [string, any]) => call[0] === Events.SET_STORIES)[1]
).toMatchInlineSnapshot(`
@ -273,7 +273,7 @@ describe('start', () => {
clientApi.storiesOf('Component C', { id: 'file1' } as NodeModule).add('default', jest.fn());
});
await waitForEvents([Events.SET_STORIES]);
await waitForRender();
expect(mockChannel.emit).toHaveBeenCalledWith(Events.STORY_RENDERED, 'component-a--default');
@ -585,7 +585,7 @@ describe('start', () => {
const { configure } = start(render);
configure('test', () => [componentCExports]);
await waitForEvents([Events.SET_STORIES]);
await waitForRender();
expect(
mockChannel.emit.mock.calls.find((call: [string, any]) => call[0] === Events.SET_STORIES)[1]
).toMatchInlineSnapshot(`
@ -956,7 +956,7 @@ describe('start', () => {
return [componentCExports];
});
await waitForEvents([Events.SET_STORIES]);
await waitForRender();
expect(
mockChannel.emit.mock.calls.find((call: [string, any]) => call[0] === Events.SET_STORIES)[1]
).toMatchInlineSnapshot(`