I'm trying to write some Snapshot tests using SnapshotTesting
for my SwiftUI views. If I use
.image(layout: .device(config: .iPhone8Plus))
my view gets an extra padding at the top as shown in the first image. This is using an M1 Mac with Xcode on Rosetta. The funny thing is, that when the same code runs on Bitrise CI, it doesn't add the padding which makes the tests fail on CI.
On the other hand if I use:
.image(layout: .fixed(width: 375, height: 750))
my view doesn't get any unnecessary padding, and everything works fine on local Xcode and Bitrise CI.
Has anyone ever come across such an issue? And if yes, is there a fix that allows us to keep using device configs.