-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add a sample snapshot test for a SwiftUI View #600
Conversation
|
App Name | ||
Build Number | 1897 | |
Version | 1.0 | |
Bundle ID | com.automattic.gravatar-sdk-demo-uikit.prototype-build | |
Commit | b8ed089 | |
App Center Build | Gravatar SDK Demo - UIKit #482 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question:
Is there a way to snapshot only de view without the whole bound of the device screen?
Can you check again? @etoledom I think I found a way to make |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great 👍
Closes part of #539
Description
Adds a snapshot test for
AvatarPickerProfileView
to demonstrate how we can do snapshot testing for SwiftUI Views.Uses
Snapshotting.image(...)
strategy from the existing snapshot library. It is a snapshot strategy for comparing SwiftUI Views based on pixel equality. There are differentlayout
types we can pass, but.sizeThatFits
didn't work well for this view not sure why. So I just used.device
and put some red borders around the content so the bounds are also visible and comparable.Testing Steps
CI green.