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

Support snapshotting SwiftUI views #283

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

younata
Copy link
Collaborator

@younata younata commented Sep 6, 2024

Protocols can't be extended to conform to other protocols, sadly.
So this duplicates the haveValidSnapshot/recordSnapshot matchers with ones that take in a SwiftUI View. Then, inside of that, the SwiftUI View is converted to a Snapshotable, and we delegate to the appropriate matcher for snapshotable.

Fixes #252

Copy link
Owner

@ashfurrow ashfurrow left a comment

Choose a reason for hiding this comment

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

This is super-cool, thank you! I'm guessing you've tested this manually? Ideally we would have a unit test for this, but I don't want to block merging for the sake of a missing test. Let me know, and we'll get this merged + deployed.

Thanks again!

@ashfurrow
Copy link
Owner

(The Danger failure isn't due to your change, it's a permissions issue. I'm thinking of removing it entirely to prevent me from responding to every PR from a fork with "the failure isn't your fault!")

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.

Support for SwiftUI?
2 participants