swift-snapshot-testing icon indicating copy to clipboard operation
swift-snapshot-testing copied to clipboard

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

Open pineapple216 opened this issue 3 years ago • 10 comments

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

  • swift-snapshot-testing version 1.10.0
  • Xcode 14.0.1
  • Swift 5.7
  • OS: 16

Additional context Add any more context about the problem here.

pineapple216 avatar Oct 25 '22 12:10 pineapple216

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

Mittchel avatar Oct 25 '22 12:10 Mittchel

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

alexanderkhitev avatar Dec 28 '22 16:12 alexanderkhitev

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

JoeManto avatar Mar 09 '23 15:03 JoeManto

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.

zero3nna avatar Mar 10 '23 13:03 zero3nna

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

baderbenzribia avatar Aug 07 '23 10:08 baderbenzribia

+1 Facing the same issue

ba01ei avatar Feb 01 '24 00:02 ba01ei

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

jdouglas-nz avatar Mar 07 '24 04:03 jdouglas-nz