From 61dac1a717b5b9340788d30786cb91fa4540cfc7 Mon Sep 17 00:00:00 2001 From: kean Date: Fri, 12 Jul 2024 20:57:16 -0400 Subject: [PATCH] Fix unit tests --- WordPress.xcworkspace/xcshareddata/swiftpm/Package.resolved | 2 +- WordPress/Classes/Utility/PushNotificationsManager.swift | 1 + .../WordPressTest/Classes/Stores/ActivityStoreTests.swift | 2 +- WordPress/WordPressTest/MockWordPressComRestApi.swift | 2 +- WordPress/WordPressTest/SiteCreation/SiteCreatorTests.swift | 4 ++-- WordPress/WordPressTest/StatsPeriodAsyncOperationTests.swift | 3 ++- .../ViewRelated/Tools/Time Zone/TimeZoneFormatterTests.swift | 3 ++- .../Tools/Time Zone/TimeZoneSelectorViewModelTests.swift | 3 ++- .../What's New/Data store/Announcement+Fixture.swift | 2 +- .../What's New/Data store/AnnouncementsDataStoreTests.swift | 5 +++-- WordPress/WordPressTest/ZendeskUtilsTests+Plans.swift | 2 +- .../Tests/Mocks/WordPressAuthenticatorDelegateSpy.swift | 1 + 12 files changed, 18 insertions(+), 12 deletions(-) diff --git a/WordPress.xcworkspace/xcshareddata/swiftpm/Package.resolved b/WordPress.xcworkspace/xcshareddata/swiftpm/Package.resolved index 7f10e2881cb0..dcd0857bba14 100644 --- a/WordPress.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/WordPress.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -428,7 +428,7 @@ "location" : "https://github.com/wordpress-mobile/WordPressKit-iOS", "state" : { "branch" : "wpios-edition", - "revision" : "064625fa7ebc448a34b656644f051b9257939655" + "revision" : "90923d3125d6427e66fda4bb8cec309408257126" } }, { diff --git a/WordPress/Classes/Utility/PushNotificationsManager.swift b/WordPress/Classes/Utility/PushNotificationsManager.swift index 71319bed19ba..2f11208ca1ef 100644 --- a/WordPress/Classes/Utility/PushNotificationsManager.swift +++ b/WordPress/Classes/Utility/PushNotificationsManager.swift @@ -1,5 +1,6 @@ import Foundation import WordPressShared +import NSObject_SafeExpectations import UserNotifications import CocoaLumberjack diff --git a/WordPress/WordPressTest/Classes/Stores/ActivityStoreTests.swift b/WordPress/WordPressTest/Classes/Stores/ActivityStoreTests.swift index 4ccd34daaffc..cd77d6c719ad 100644 --- a/WordPress/WordPressTest/Classes/Stores/ActivityStoreTests.swift +++ b/WordPress/WordPressTest/Classes/Stores/ActivityStoreTests.swift @@ -1,8 +1,8 @@ import WordPressFlux import XCTest +import WordPressKit @testable import WordPress -@testable import WordPressKit class ActivityStoreTests: CoreDataTestCase { private var dispatcher: ActionDispatcher! diff --git a/WordPress/WordPressTest/MockWordPressComRestApi.swift b/WordPress/WordPressTest/MockWordPressComRestApi.swift index 484084267857..550bffa8ad3b 100644 --- a/WordPress/WordPressTest/MockWordPressComRestApi.swift +++ b/WordPress/WordPressTest/MockWordPressComRestApi.swift @@ -1,5 +1,5 @@ import Foundation -@testable import WordPressKit +import WordPressKit class MockWordPressComRestApi: WordPressComRestApi { var getMethodCalled = false diff --git a/WordPress/WordPressTest/SiteCreation/SiteCreatorTests.swift b/WordPress/WordPressTest/SiteCreation/SiteCreatorTests.swift index 755c027bdc70..01e7d39ed6ce 100644 --- a/WordPress/WordPressTest/SiteCreation/SiteCreatorTests.swift +++ b/WordPress/WordPressTest/SiteCreation/SiteCreatorTests.swift @@ -1,7 +1,7 @@ - import XCTest +import WordPressKit + @testable import WordPress -@testable import WordPressKit // MARK: - SiteCreatorTests diff --git a/WordPress/WordPressTest/StatsPeriodAsyncOperationTests.swift b/WordPress/WordPressTest/StatsPeriodAsyncOperationTests.swift index 8c6a63c5786f..3cc4c477a5ff 100644 --- a/WordPress/WordPressTest/StatsPeriodAsyncOperationTests.swift +++ b/WordPress/WordPressTest/StatsPeriodAsyncOperationTests.swift @@ -1,6 +1,7 @@ import XCTest +import WordPressKit + @testable import WordPress -@testable import WordPressKit class StatsPeriodAsyncOperationTests: XCTestCase { private let date = Date() diff --git a/WordPress/WordPressTest/ViewRelated/Tools/Time Zone/TimeZoneFormatterTests.swift b/WordPress/WordPressTest/ViewRelated/Tools/Time Zone/TimeZoneFormatterTests.swift index dcfeb9e21072..340618407a2d 100644 --- a/WordPress/WordPressTest/ViewRelated/Tools/Time Zone/TimeZoneFormatterTests.swift +++ b/WordPress/WordPressTest/ViewRelated/Tools/Time Zone/TimeZoneFormatterTests.swift @@ -1,6 +1,7 @@ import XCTest +import WordPressKit + @testable import WordPress -@testable import WordPressKit class TimeZoneFormatterTests: XCTestCase { diff --git a/WordPress/WordPressTest/ViewRelated/Tools/Time Zone/TimeZoneSelectorViewModelTests.swift b/WordPress/WordPressTest/ViewRelated/Tools/Time Zone/TimeZoneSelectorViewModelTests.swift index 301c72a902ef..4acec6c9f726 100644 --- a/WordPress/WordPressTest/ViewRelated/Tools/Time Zone/TimeZoneSelectorViewModelTests.swift +++ b/WordPress/WordPressTest/ViewRelated/Tools/Time Zone/TimeZoneSelectorViewModelTests.swift @@ -1,7 +1,8 @@ import Foundation import XCTest +import WordPressKit + @testable import WordPress -@testable import WordPressKit class TimeZoneSelectorViewModelTests: CoreDataTestCase { diff --git a/WordPress/WordPressTest/What's New/Data store/Announcement+Fixture.swift b/WordPress/WordPressTest/What's New/Data store/Announcement+Fixture.swift index f3be3d2201cf..e9f1df3724eb 100644 --- a/WordPress/WordPressTest/What's New/Data store/Announcement+Fixture.swift +++ b/WordPress/WordPressTest/What's New/Data store/Announcement+Fixture.swift @@ -1,4 +1,4 @@ -@testable import WordPressKit // Announcement is defined here +import WordPressKit // Announcement is defined here extension Announcement { diff --git a/WordPress/WordPressTest/What's New/Data store/AnnouncementsDataStoreTests.swift b/WordPress/WordPressTest/What's New/Data store/AnnouncementsDataStoreTests.swift index 20c6ea5b319d..f93d9e73bd4b 100644 --- a/WordPress/WordPressTest/What's New/Data store/AnnouncementsDataStoreTests.swift +++ b/WordPress/WordPressTest/What's New/Data store/AnnouncementsDataStoreTests.swift @@ -1,8 +1,9 @@ -@testable import WordPress -@testable import WordPressKit import XCTest +import WordPressKit import WordPressFlux +@testable import WordPress + struct MockAnnouncementsCache: AnnouncementsCache { var announcements: [Announcement]? diff --git a/WordPress/WordPressTest/ZendeskUtilsTests+Plans.swift b/WordPress/WordPressTest/ZendeskUtilsTests+Plans.swift index 8b500fd3fc7e..484bc694a49a 100644 --- a/WordPress/WordPressTest/ZendeskUtilsTests+Plans.swift +++ b/WordPress/WordPressTest/ZendeskUtilsTests+Plans.swift @@ -1,8 +1,8 @@ import XCTest import ZendeskCoreSDK +import WordPressKit @testable import WordPress -@testable import WordPressKit class ZendeskUtilsPlans: XCTestCase { diff --git a/WordPressAuthenticator/Tests/Mocks/WordPressAuthenticatorDelegateSpy.swift b/WordPressAuthenticator/Tests/Mocks/WordPressAuthenticatorDelegateSpy.swift index ff9ab9d51709..e57d82f77121 100644 --- a/WordPressAuthenticator/Tests/Mocks/WordPressAuthenticatorDelegateSpy.swift +++ b/WordPressAuthenticator/Tests/Mocks/WordPressAuthenticatorDelegateSpy.swift @@ -1,5 +1,6 @@ @testable import WordPressAuthenticator import WordPressKit +import WordPressShared class WordPressAuthenticatorDelegateSpy: WordPressAuthenticatorDelegate { var dismissActionEnabled: Bool = true