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

VRT: Mock avatars to return stable images #4547

Merged
merged 3 commits into from
May 1, 2024

Conversation

siddharthkp
Copy link
Member

@siddharthkp siddharthkp commented May 1, 2024

Context:

To make our stories realistic and useful, we use examples of real collaborations in our stories (instead of fake or generated data). This is very nice!

This also means when one of the collaborators updates their avatar, some of stories also update. This is also very nice!

But, this also means that our visual tests can fail because they have the old avatar in snapshots to compare. This is not nice at all! 😓 Most recently reported in #4532 (comment)

Screenshot of before and after of ActionList when someone changes their avatar

Solution:

Added a route mock for our e2e tests (visual tests) that always returns the same image that is safe for visual comparisons. Chose the primer avatar for this. (could have also used a static image, but this feels as good)

Alternatives considered:

  • Use static images in storybook instead of real avatars. Did not chose this option because it's easy to forget in future stories without linting/checks. Also, I personally like that our stories have real avatars :)

Rollout strategy

  • None; affects only tests

Merge checklist

Copy link

changeset-bot bot commented May 1, 2024

⚠️ No Changeset found

Latest commit: 0941577

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@siddharthkp siddharthkp added the skip changeset This change does not need a changelog label May 1, 2024
@siddharthkp siddharthkp self-assigned this May 1, 2024
@siddharthkp siddharthkp changed the title VRT: Mock avatar images to return stable images VRT: Mock avatars to return stable images May 1, 2024
Copy link
Contributor

github-actions bot commented May 1, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 87.98 KB (0%)
packages/react/dist/browser.umd.js 88.28 KB (0%)

@siddharthkp siddharthkp requested review from langermank and removed request for maximedegreve May 1, 2024 17:12
@siddharthkp siddharthkp enabled auto-merge May 1, 2024 17:12

This comment was marked as resolved.

Copy link
Contributor

@langermank langermank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😂

@siddharthkp siddharthkp added this pull request to the merge queue May 1, 2024
Merged via the queue into main with commit 43a193c May 1, 2024
32 checks passed
@siddharthkp siddharthkp deleted the e2e-tests-mock-avatar-image branch May 1, 2024 17:44
lukasoppermann pushed a commit that referenced this pull request May 3, 2024
* just trying something out

* should come sooner

* test(vrt): update snapshots

---------

Co-authored-by: siddharthkp <siddharthkp@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip changeset This change does not need a changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants