BarredEwe / Prefire

🔥 A library based on SwiftUI Preview, for easy generation: Playbook view, Snapshot and Accessibility tests
Apache License 2.0
290 stars 18 forks source link

Form Rows do not keep the continuity of their side edges in snapshot #27

Closed Velin92 closed 11 months ago

Velin92 commented 1 year ago

How to reproduce

Just make a very simple form view like this:

static var previews: some View {
        Form {
            Section("Test") {
                Text("Row 1")
                Text("Row 2")
            }
        }
    }

The preview that SwiftUI Canvas shows is the following:

Screenshot 2023-09-22 at 11 04 41

The generated previews instead is: test_compoundIcon Test

Is very subtle but if you check the edges on the sides of the two rows you will see that the rounding happens PER ROW in the preview snapshot, instead of happening only at the end and at the start of the row like in the SwiftUI preview.

These happens for all views that use the system rows.

Screenshot 2023-09-22 at 11 04 41

test_compoundIcon Test

BarredEwe commented 1 year ago

Hi! Prefire uses the library - swift snapshot testing inside. I tried to reproduce using this library and the bug is also reproduced.

As I understand it, the problem is that the library uses SwiftUI.View wraps in a UIHostingViewController. I will try to look for an alternative or a workaround to this problem. In the meantime, I recommend bringing this problem to the library repository.