Skip to content

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

@siddharthkp siddharthkp added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label May 1, 2024
@siddharthkp siddharthkp requested review from joshblack and pksjce May 1, 2024 13:43
@siddharthkp siddharthkp requested a review from a team as a code owner May 1, 2024 13:43
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%)

@github-actions github-actions bot temporarily deployed to storybook-preview-4547 May 1, 2024 13:47 Inactive
@siddharthkp siddharthkp requested a review from a team as a code owner May 1, 2024 13:50
@siddharthkp siddharthkp requested a review from maximedegreve May 1, 2024 13:50
@github-actions github-actions bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label May 1, 2024
@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
@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 <[email protected]>
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