From 0bfd932196e51de2f487491585595f3d02151d0d Mon Sep 17 00:00:00 2001 From: Felix Mau Date: Mon, 15 Aug 2022 21:33:58 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20::=20Adapt=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GradientActivityIndicatorViewModelTestCase.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Example/ExampleTests/ViewModel/GradientActivityIndicatorViewModelTestCase.swift b/Example/ExampleTests/ViewModel/GradientActivityIndicatorViewModelTestCase.swift index 6347723..d1f074f 100644 --- a/Example/ExampleTests/ViewModel/GradientActivityIndicatorViewModelTestCase.swift +++ b/Example/ExampleTests/ViewModel/GradientActivityIndicatorViewModelTestCase.swift @@ -103,9 +103,12 @@ final class GradientActivityIndicatorViewModelTestCase: XCTestCase { } receivedIsAnimating.removeAll() + let size = CGSize(width: .random(in: 1 ... 100), height: .random(in: 1 ... 100)) + let bounds = CGRect(origin: .zero, size: size) + // When withExtendedLifetime(disposable) { - viewModel.bounds = CGRect(origin: .zero, size: .zero) + viewModel.bounds = bounds } // Then @@ -120,6 +123,9 @@ final class GradientActivityIndicatorViewModelTestCase: XCTestCase { receivedIsAnimating.append(isAnimating) } + let size = CGSize(width: .random(in: 1 ... 100), height: .random(in: 1 ... 100)) + let bounds = CGRect(origin: .zero, size: size) + viewModel.isHidden = true receivedIsAnimating.removeAll()