From 9583cea12acbb58cf26cf18b7bf408b1fb4a3a3b Mon Sep 17 00:00:00 2001 From: Tomas Nygren Date: Tue, 17 May 2022 22:59:48 +1000 Subject: [PATCH] remove repeated test --- lib/preview-web/src/PreviewWeb.test.ts | 41 -------------------------- 1 file changed, 41 deletions(-) diff --git a/lib/preview-web/src/PreviewWeb.test.ts b/lib/preview-web/src/PreviewWeb.test.ts index c0ebdf31dfce..ba915bbf1bc7 100644 --- a/lib/preview-web/src/PreviewWeb.test.ts +++ b/lib/preview-web/src/PreviewWeb.test.ts @@ -1230,47 +1230,6 @@ describe('PreviewWeb', () => { updatedArgs: { foo: 'a' }, }); }); - - it('resets all args when one arg is not set initially', async () => { - document.location.search = '?id=component-one--a'; - const preview = await createAndRenderPreview(); - const onUpdateArgsSpy = jest.spyOn(preview, 'onUpdateArgs'); - - emitter.emit(Events.UPDATE_STORY_ARGS, { - storyId: 'component-one--a', - updatedArgs: { foo: 'new', notSetInitially: 'exampleValue' }, - }); - await waitForEvents([Events.STORY_ARGS_UPDATED]); - - mockChannel.emit.mockClear(); - emitter.emit(Events.RESET_STORY_ARGS, { - storyId: 'component-one--a', - }); - - await waitForRender(); - - expect(projectAnnotations.renderToDOM).toHaveBeenCalledWith( - expect.objectContaining({ - forceRemount: false, - storyContext: expect.objectContaining({ - initialArgs: { foo: 'a' }, - args: { foo: 'a' }, - }), - }), - undefined // this is coming from view.prepareForStory, not super important - ); - - await waitForEvents([Events.STORY_ARGS_UPDATED]); - expect(mockChannel.emit).toHaveBeenCalledWith(Events.STORY_ARGS_UPDATED, { - storyId: 'component-one--a', - args: { foo: 'a' }, - }); - - expect(onUpdateArgsSpy).toHaveBeenCalledWith({ - storyId: 'component-one--a', - updatedArgs: { foo: 'a', notSetInnately: undefined }, - }); - }); }); describe('on FORCE_RE_RENDER', () => {