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] Inconsistent Storybook Snapshot Tests Between Local Environment and GitHub Actions #401
Comments
Hey there @mtroskot, thanks for opening this issue. |
Hi @yannbf, |
Thank you so much @mtroskot! I suspected the issue could have been running Storybook in prod mode, so I added this to package.json and ran it locally but the issue didn't happen:
Unfortunately (or fortunately) I am going on vacation so I can't spend more time in this right now. I pushed the script change to your repo and the snapshot diff was actually bigger, even though my change was essentially a refactor of the GH action script. I am suspecting the issue could be related to the swiper element you are using. I assume if you were to try to reproduce this issue in a basic element, without 3rd party components, that wouldn't happen. Could be related to internal logic of handling classnames from that Sorry I couldn't be more useful for now! |
Thanks @yannbf for taking a look, should we close this issue or leave it as is ? |
Describe the bug
When running Storybook Snapshot tests using test-runner on GitHub Actions against non-deployed Storybooks, the snapshots generated are inconsistent compared to local runs. The differences observed in the snapshots seem to be related to the class order and styling, specifically in the Tailwind CSS classes.
To Reproduce
1.Steps to reproduce the behavior:
2.Run the Storybook Snapshot tests locally.
3.Run the Storybook Snapshot tests on GitHub Actions.
4.Compare the generated snapshots for differences.
Expected behavior
The snapshots generated locally and on GitHub Actions should be consistent, with no differences in class order or styling.
Screenshots
System
System:
OS: macOS 13.5.2
CPU: (8) arm64 Apple M1
Binaries:
Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm
Browsers:
Chrome: 119.0.6045.159
Safari: 16.6
npmPackages:
@storybook/addon-a11y: ^7.5.1 => 7.5.1
@storybook/addon-essentials: ^7.4.6 => 7.4.6
@storybook/addon-interactions: ^7.4.6 => 7.4.6
@storybook/addon-links: ^7.4.6 => 7.4.6
@storybook/addon-onboarding: ^1.0.8 => 1.0.8
@storybook/addon-styling-webpack: ^0.0.5 => 0.0.5
@storybook/blocks: ^7.4.6 => 7.4.6
@storybook/nextjs: ^7.4.6 => 7.4.6
@storybook/react: ^7.4.6 => 7.4.6
@storybook/test-runner: ^0.15.2 => 0.15.2
@storybook/testing-library: ^0.2.2 => 0.2.2
The text was updated successfully, but these errors were encountered: