From 694e0a3aed19c1b76201a44053a73549f43848ab Mon Sep 17 00:00:00 2001 From: NachoSoto Date: Fri, 21 Jul 2023 07:22:55 +0200 Subject: [PATCH] `Paywalls`: disable animations during unit tests (#2848) This improves snapshot tests, and means we can reduce the polling time. --- Tests/UnitTests/TestHelpers/SnapshotTesting+Extensions.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tests/UnitTests/TestHelpers/SnapshotTesting+Extensions.swift b/Tests/UnitTests/TestHelpers/SnapshotTesting+Extensions.swift index 81f5b3bf70..61f96749bc 100644 --- a/Tests/UnitTests/TestHelpers/SnapshotTesting+Extensions.swift +++ b/Tests/UnitTests/TestHelpers/SnapshotTesting+Extensions.swift @@ -54,6 +54,8 @@ extension SwiftUI.View { file: StaticString = #file, line: UInt = #line ) { + UIView.setAnimationsEnabled(false) + // Add test view to the hierarchy to make sure async rendering takes place. // The tested view is `controller.view` instead of `self` to keep it in memory // while rendering happens