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

Don't skip interactive screenshots for first item #130

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

trotzig
Copy link
Contributor

@trotzig trotzig commented Sep 18, 2024

When the first story in the list of stories in the whole storybook had a play function together with forceHappoScreenshot, we wouldn't include these screenshots in the report. This was because the check to see if we were currently running Happo was checking for currentIndex. This variable starts as 0/falsy. To fix this, I'm instead checking to see if the normal init process has produced any examples. If not, we know we're not running Happo.

The bug that would materialize from this would be that the first story would only have one screenshot. The ones produced via forceHappoScreenshot inside the play function would be ignored. This problem would also be present multiple times if you were using chunks config in .happo.js. Every interactive story at the start of each chunk would also have missing screenshots.

When the first story in the list of stories in the whole storybook had a
play function together with forceHappoScreenshot, we wouldn't include
these screenshots in the report. This was because the check to see if we
were currently running Happo was checking for `currentIndex`. This
variable starts as `0`/falsy. To fix this, I'm instead checking to see
if the normal init process has produced any examples. If not, we know
we're not running Happo.

The bug that would materialize from this would be that the first story
would only have one screenshot. The ones produced via
forceHappoScreenshot inside the play function would be ignored. This
problem would also be present multiple times if you were using `chunks`
config in .happo.js. Every interactive story at the start of each chunk
would also have missing screenshots.
@trotzig
Copy link
Contributor Author

trotzig commented Sep 18, 2024

The storybook 7 build was stuck on yarn install. I'm going to merge anyway.

@trotzig trotzig merged commit 8de290b into main Sep 18, 2024
5 of 6 checks passed
@trotzig trotzig deleted the fix-missing-interactive branch September 18, 2024 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant