cashapp / AccessibilitySnapshot

Easy regression testing for iOS accessibility
Apache License 2.0
541 stars 68 forks source link

Make SnapshotTesting Accessibility Functions for ContentSizeCategory public #44

Closed fbernutz closed 3 years ago

fbernutz commented 3 years ago

The two extending functions on Snapshotting for UIView and UIViewController in SnapshotTesting+Accessibility.swift which make it possible to modify the content size category for the snapshot should be public, so they can be used outside the target.

Issue exists in Version 0.4.0 of AccessibilitySnapshot

fbernutz commented 3 years ago

Just saw that this functionality is available from the original SnapshotLibrary (https://github.com/cashapp/AccessibilitySnapshot/issues/4#issuecomment-711072620). So feel free to close this issue and the PR.

This was the change I needed to make to get the same functionality, if others are having the same issue.

-            as: .image(at: .accessibilityLarge)
+            as: .image(traits: .init(preferredContentSizeCategory: .accessibilityLarge))
NickEntin commented 3 years ago

Closing this issue as a duplicate since it's already tracked by #4. Thanks for the reminder though! I'll try to carve out some time to verify whether there's anything additional we need to do for the SnapshotTesting subspec, and if not then remove the methods. We definitely still need to do work for the iOSSnapshotTestCase subspec.