From 207fe6649f9f0137ba65beda51c2f2e6df66ff9b Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 6 Oct 2025 10:59:25 -0700 Subject: [PATCH] Skip refreshing in local and Feedly accounts if running unit tests. --- .../Sources/Account/Feedly/FeedlyAccountDelegate.swift | 7 ++++++- .../Account/LocalAccount/LocalAccountDelegate.swift | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift b/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift index a3c0f9f48..cd7300c4c 100644 --- a/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift +++ b/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift @@ -110,7 +110,12 @@ final class FeedlyAccountDelegate: AccountDelegate { func refreshAll(for account: Account, completion: @escaping (Result) -> Void) { assert(Thread.isMainThread) - + + guard !Platform.isRunningUnitTests else { + Self.logger.debug("Feedly: Ignoring refreshAll: running unit tests") + completion(.success(())) + return + } guard currentSyncAllOperation == nil else { Self.logger.debug("Feedly: Ignoring refreshAll: sync already in progress") completion(.success(())) diff --git a/Modules/Account/Sources/Account/LocalAccount/LocalAccountDelegate.swift b/Modules/Account/Sources/Account/LocalAccount/LocalAccountDelegate.swift index 0dcc5148f..557ce3247 100644 --- a/Modules/Account/Sources/Account/LocalAccount/LocalAccountDelegate.swift +++ b/Modules/Account/Sources/Account/LocalAccount/LocalAccountDelegate.swift @@ -44,7 +44,7 @@ final class LocalAccountDelegate: AccountDelegate { } func refreshAll(for account: Account, completion: @escaping (Result) -> Void) { - guard refreshProgress.isComplete else { + guard refreshProgress.isComplete, !Platform.isRunningUnitTests else { completion(.success(())) return }