pointfreeco / swift-snapshot-testing

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

List seperator in a SwiftUI list doesn't match between snapshot and simulator #667

Open pineapple216 opened 1 year ago

pineapple216 commented 1 year ago

Describe the bug The list in a SwiftUI list looks different in snapshot. In the simulator and preview only the top and bottom items have rounded corners, in the snapshot all items have rounded corners.

To Reproduce Zip up a project that reproduces the behavior and attach it by dragging it here. snapshottesting-bug-project.zip

Expected behavior I would expect the screenshots to match the previews and simulator.

Screenshots

The output of the snap shot test, on iPhone 13

testviewToTestViewOniPhone13PortraitLightMode 1

The output of the preview, on iPhone 13

Screenshot 2022-10-25 at 14 46 12

Environment

Additional context Add any more context about the problem here.

Mittchel commented 1 year ago

We are also experiencing this exact issue, would be great to have a resolution to this.

alexanderkhitev commented 1 year ago

Hey! I faced the same issue. Do you have any solutions/updates for it? Thanks.

JoeManto commented 1 year ago

I've found using .image(drawHierarchyInKeyWindow: true) fixes this issue

zero3nna commented 1 year ago

I've found using .image(drawHierarchyInKeyWindow: true) fixes this issue

Did not change anything for me... the issue is still there running it with host application and drawHierarchyInKeyWindow.

baderbenzribia commented 1 year ago

Facing the same issue. Any update on this? Thanks!

ba01ei commented 8 months ago

+1 Facing the same issue

jdouglas-nz commented 7 months ago

I've found using .image(drawHierarchyInKeyWindow: true) fixes this issue

@JoeManto thank you so much ! This fixed it for me. My context was a little bit different, I was using a Form with textfields, not a List

cprince-foreflight commented 12 hours ago

That .image(drawHierarchyInKeyWindow: true) work-around seems to disallow trying to run the snapshot tests in a standalone Swift package. I get the following when trying it in my Swift package:

Screenshot 2024-10-03 at 9 45 02 AM
cprince-foreflight commented 12 hours ago

We're running into the same issue. Any progress on resolving?