Skip to content

Commit

Permalink
remove repeated test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomastomaslol committed May 17, 2022
1 parent b56b1ce commit 9583cea
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions lib/preview-web/src/PreviewWeb.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit 9583cea

Please sign in to comment.