Skip to content

Commit

Permalink
[tests] update tests to build after changes
Browse files Browse the repository at this point in the history
* Executors init take in additional argument
* A failing test needs more time to complete
  • Loading branch information
nan-li committed Aug 14, 2024
1 parent 37108ae commit 4390d1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ final class SwitchUserIntegrationTests: XCTestCase {
// Increase flush interval to allow all the updates to batch
OSOperationRepo.sharedInstance.pollIntervalMilliseconds = 300
// Wait to let any pending flushes in the Operation Repo to run
OneSignalCoreMocks.waitForBackgroundThreads(seconds: 0.1)
OneSignalCoreMocks.waitForBackgroundThreads(seconds: 0.3)

// 1. Set up mock responses for the first anonymous user
let tagsUserAnon = ["tag_anon": "value_anon"]
Expand Down Expand Up @@ -369,7 +369,7 @@ final class SwitchUserIntegrationTests: XCTestCase {
OneSignalUserManagerImpl.sharedInstance.addEmail("[email protected]")

// 3. Run background threads
OneSignalCoreMocks.waitForBackgroundThreads(seconds: 0.5)
OneSignalCoreMocks.waitForBackgroundThreads(seconds: 2)

/* Then */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ final class UserConcurrencyTests: XCTestCase {
)
OneSignalCoreImpl.setSharedClient(client)

let executor = OSSubscriptionOperationExecutor()
let executor = OSSubscriptionOperationExecutor(newRecordsState: OSNewRecordsState())
OSOperationRepo.sharedInstance.addExecutor(executor)

/* When */
Expand Down Expand Up @@ -131,7 +131,7 @@ final class UserConcurrencyTests: XCTestCase {
OneSignalCoreImpl.setSharedClient(client)
MockUserRequests.setAddAliasesResponse(with: client, aliases: aliases)

let executor = OSIdentityOperationExecutor()
let executor = OSIdentityOperationExecutor(newRecordsState: OSNewRecordsState())
OSOperationRepo.sharedInstance.addExecutor(executor)

/* When */
Expand Down Expand Up @@ -172,7 +172,7 @@ final class UserConcurrencyTests: XCTestCase {
let identityModel = OSIdentityModel(aliases: [OS_ONESIGNAL_ID: UUID().uuidString], changeNotifier: OSEventProducer())
OneSignalUserManagerImpl.sharedInstance.addIdentityModelToRepo(identityModel)

let executor = OSPropertyOperationExecutor()
let executor = OSPropertyOperationExecutor(newRecordsState: OSNewRecordsState())
OSOperationRepo.sharedInstance.addExecutor(executor)

/* When */
Expand Down Expand Up @@ -213,7 +213,7 @@ final class UserConcurrencyTests: XCTestCase {
let identityModel1 = OSIdentityModel(aliases: [OS_ONESIGNAL_ID: UUID().uuidString], changeNotifier: OSEventProducer())
let identityModel2 = OSIdentityModel(aliases: [OS_ONESIGNAL_ID: UUID().uuidString], changeNotifier: OSEventProducer())

let userExecutor = OSUserExecutor()
let userExecutor = OSUserExecutor(newRecordsState: OSNewRecordsState())

/* When */

Expand Down

0 comments on commit 4390d1b

Please sign in to comment.