cypress-storybook
cypress-storybook copied to clipboard
forceReRender was removed in storyStoreV7, breaking cypress-storybook
Storybook 6.4 has the ability to turn on a flag and enable storyStorev7
https://storybook.js.org/docs/react/configure/overview#feature-flags
storyStorev7 removed the forceReRender api https://github.com/storybookjs/storybook/blob/next/lib/core-client/src/preview/start.ts#L45
cypress-storybook relies on forceReRender to be called anytime knobs change
https://github.com/NicholasBoll/cypress-storybook/blob/master/react.js#L18
Seeing as knobs have been deprecated for a while, it seems reasonable to remove support knobs for them in a major release and remove the dependence on a forceReRender
https://storybook.js.org/addons/@storybook/addon-knobs
Hi Micah, I had the same issue, we added the following to have it working again in Storybook 7. Maybe it will help you with fixing your issue as well.
` import { addons } from '@storybook/preview-api'; import { FORCE_RE_RENDER } from '@storybook/core-events';
//re-render call addons.getChannel().emit(FORCE_RE_RENDER) `
Glad i'm not the only one facing this
@yunic-nl Where did you add this? My test fails first thing when loading the story in the one and only beforeEach
beforeEach(() => cy.visitStorybook().loadStory('AsyncValidation', 'Primary'));
We used it in the preview.ts (working on Angular project)