pointfreeco / swift-snapshot-testing

📸 Delightful Swift snapshot testing.
https://www.pointfree.co/episodes/ep41-a-tour-of-snapshot-testing
MIT License
3.73k stars 565 forks source link

Preserve View margins for snapshots #757

Open leohemanth opened 1 year ago

leohemanth commented 1 year ago

This addresses the issue: https://github.com/pointfreeco/swift-snapshot-testing/issues/750

Looks like we are trying to update ViewController's root view's frame to avoid safe area influence, but this would change the directionalLayoutMargins of the view.

This PR updates the strategy to restore the margins after we update the frame.

This PR also adds unit tests for the same.