Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: storyshots with Angular 15 does not work #20205

Closed
TimGeisler opened this issue Dec 12, 2022 · 3 comments
Closed

[Bug]: storyshots with Angular 15 does not work #20205

TimGeisler opened this issue Dec 12, 2022 · 3 comments

Comments

@TimGeisler
Copy link

Describe the bug

Using addon shoryshots with Angular 15 and jest-preset-angular 12.2.3 does not work, since the jest setup has changed:

src/app/storyshots.test.ts
  ● Test suite failed to run

    Cannot find module 'jest-preset-angular/build/setup-jest' from 'node_modules/@storybook/addon-storyshots/dist/ts3.9/frameworks/angular/loader.js'

      1 | import initStoryshots from '@storybook/addon-storyshots'
      2 |
    > 3 | initStoryshots({})
        |               ^
      4 |

      at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:425:11)
      at setupAngularJestPreset (node_modules/@storybook/addon-storyshots/dist/ts3.9/frameworks/angular/loader.js:25:14)
      at Object.load (node_modules/@storybook/addon-storyshots/dist/ts3.9/frameworks/angular/loader.js:32:5)
      at Object.loadFramework [as default] (node_modules/@storybook/addon-storyshots/dist/ts3.9/frameworks/frameworkLoader.js:26:19)
      at testStorySnapshots (node_modules/@storybook/addon-storyshots/dist/ts3.9/api/index.js:28:94)
      at Object.<anonymous> (src/app/storyshots.test.ts:3:15)

To Reproduce

No response

System

No response

Additional context

"@storybook/addon-actions": "^6.5.14",
"@storybook/addon-essentials": "^6.5.14",
"@storybook/addon-interactions": "^6.5.14",
"@storybook/addon-links": "^6.5.14",
"@storybook/addon-storyshots": "^6.5.14",
"@storybook/angular": "^6.5.14",
"@storybook/builder-webpack5": "^6.5.14",
"@storybook/manager-webpack5": "^6.5.14",
"@storybook/testing-library": "^0.0.13",
"@testing-library/angular": "^12.3.0",
"@testing-library/dom": "^8.19.0",
"@testing-library/jest-dom": "^5.16.5",
"jest": "^29.3.1",
"jest-preset-angular": "^12.2.3",
@ndelangen
Copy link
Member

The future of storyshots is the test-runner:
https://storybook.js.org/docs/react/writing-tests/test-runner#page-top

And use the play function for expectations:
https://storybook.js.org/docs/react/writing-stories/play-function#page-top

We will not be making any improvement / changes to storyshots.

@MichaelBagnasco
Copy link

We will not be making any improvement / changes to storyshots.

@ndelangen Can the storyshots readme be updated to reflect this? Or at least get it working for those who want to use it. I found the fixes for it. It should be a small PR.

@MichaelBagnasco
Copy link

Nevermind. It was already fixed #20559. See commit a9f7b0c1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

5 participants