From ef630e0529557754a6a66daf7275f8e7c3327df1 Mon Sep 17 00:00:00 2001 From: Tomasz Kurylik Date: Fri, 15 Nov 2024 14:37:18 +0100 Subject: [PATCH] 1 --- Tests/Tests+PopupStack.swift | 2 +- Tests/Tests+ViewModel+PopupCenterStack.swift | 10 +++++----- Tests/Tests+ViewModel+PopupVerticalStack.swift | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Tests/Tests+PopupStack.swift b/Tests/Tests+PopupStack.swift index 625315cb6..7fe7bb3e6 100644 --- a/Tests/Tests+PopupStack.swift +++ b/Tests/Tests+PopupStack.swift @@ -254,7 +254,7 @@ private extension PopupStackTests { } func performAction(_ action: () async -> ()) async { await action() - await Task.sleep(seconds: 0.01) + await Task.sleep(seconds: 0.03) } func getPopupsForDefaultStack() async -> [AnyPopup] { await PopupStack diff --git a/Tests/Tests+ViewModel+PopupCenterStack.swift b/Tests/Tests+ViewModel+PopupCenterStack.swift index af34b9b93..bd8d462db 100644 --- a/Tests/Tests+ViewModel+PopupCenterStack.swift +++ b/Tests/Tests+ViewModel+PopupCenterStack.swift @@ -236,13 +236,10 @@ private extension PopupCenterStackViewModelTests { } func appendPopupsAndPerformChecks(popups: [AnyPopup], isKeyboardActive: Bool, calculatedValue: @escaping (ViewModel) async -> Value, expectedValueBuilder: @escaping (ViewModel) async -> Value) async { await viewModel.updatePopups(popups) - - await Task.sleep(seconds: 0.01) - + await waitForResults() await updatePopups() await viewModel.updateScreen(screenHeight: isKeyboardActive ? screenWithKeyboard.height : screen.height, screenSafeArea: isKeyboardActive ? screenWithKeyboard.safeArea : screen.safeArea, isKeyboardActive: isKeyboardActive) - - await Task.sleep(seconds: 0.01) + await waitForResults() let calculatedValue = await calculatedValue(viewModel) let expectedValue = await expectedValueBuilder(viewModel) @@ -253,6 +250,9 @@ private extension PopupCenterStackViewModelTests { func updatePopups() async { for popup in viewModel.popups { await viewModel.updatePopupHeight(popup.height!, popup) } } + func waitForResults() async { + await Task.sleep(seconds: 0.03) + } } // MARK: Screen diff --git a/Tests/Tests+ViewModel+PopupVerticalStack.swift b/Tests/Tests+ViewModel+PopupVerticalStack.swift index 24685fd31..ae10355e8 100644 --- a/Tests/Tests+ViewModel+PopupVerticalStack.swift +++ b/Tests/Tests+ViewModel+PopupVerticalStack.swift @@ -1531,7 +1531,7 @@ private extension PopupVerticalStackViewModelTests { } } func waitForResults() async { - await Task.sleep(seconds: 0.01) + await Task.sleep(seconds: 0.03) } }