Skip to content

Commit 3847755

Browse files
committed
Fix macOS precision
1 parent 96ab8c5 commit 3847755

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Example/OpenSwiftUIUITests/Render/RendererEffect/ClipEffectUITests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct ClipEffectUITests {
1919
.clipShape(Circle())
2020
}
2121
}
22-
openSwiftUIAssertSnapshot(of: ContentView(), perceptualPrecision: 0.9)
22+
openSwiftUIAssertSnapshot(of: ContentView(), precision: 0.99)
2323
}
2424

2525
@Test
@@ -31,7 +31,7 @@ struct ClipEffectUITests {
3131
.clipShape(RoundedRectangle(cornerRadius: 15))
3232
}
3333
}
34-
openSwiftUIAssertSnapshot(of: ContentView(), perceptualPrecision: 0.9)
34+
openSwiftUIAssertSnapshot(of: ContentView(), precision: 0.99)
3535
}
3636

3737
@Test
@@ -43,7 +43,7 @@ struct ClipEffectUITests {
4343
.clipShape(Capsule())
4444
}
4545
}
46-
openSwiftUIAssertSnapshot(of: ContentView(), perceptualPrecision: 0.9)
46+
openSwiftUIAssertSnapshot(of: ContentView(), precision: 0.99)
4747
}
4848

4949
@Test
@@ -70,7 +70,7 @@ struct ClipEffectUITests {
7070
.clipShape(Ellipse())
7171
}
7272
}
73-
openSwiftUIAssertSnapshot(of: ContentView(), perceptualPrecision: 0.99)
73+
openSwiftUIAssertSnapshot(of: ContentView(), precision: 0.99)
7474
}
7575
}
7676

Example/OpenSwiftUIUITests/UITests/SnapshotTesting+Testing.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ extension Snapshotting where Value == NSViewController, Format == NSImage {
5353
func openSwiftUIAssertSnapshot<V: View>(
5454
of value: @autoclosure () -> V,
5555
drawHierarchyInKeyWindow: Bool = false,
56+
precision: Float = 1,
5657
perceptualPrecision: Float = 1,
5758
size: CGSize = defaultSize,
5859
named name: String? = nil,
@@ -66,7 +67,7 @@ func openSwiftUIAssertSnapshot<V: View>(
6667
) {
6768
openSwiftUIAssertSnapshot(
6869
of: PlatformHostingController(rootView: value()),
69-
as: .image(drawHierarchyInKeyWindow: drawHierarchyInKeyWindow, perceptualPrecision: perceptualPrecision, size: size),
70+
as: .image(drawHierarchyInKeyWindow: drawHierarchyInKeyWindow, precision: precision, perceptualPrecision: perceptualPrecision, size: size),
7071
named: (name.map { ".\($0)" } ?? "") + "\(Int(size.width))x\(Int(size.height))",
7172
record: recording,
7273
timeout: timeout,

0 commit comments

Comments
 (0)