diff --git a/lib/core-client/src/preview/start.test.ts b/lib/core-client/src/preview/start.test.ts index befad7113bb..0f4c82efbdb 100644 --- a/lib/core-client/src/preview/start.test.ts +++ b/lib/core-client/src/preview/start.test.ts @@ -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(`