diff --git a/xcode/Subconscious/SubconsciousTests/TestUtilities.swift b/xcode/Subconscious/SubconsciousTests/TestUtilities.swift index 62b4998f..ba0506af 100644 --- a/xcode/Subconscious/SubconsciousTests/TestUtilities.swift +++ b/xcode/Subconscious/SubconsciousTests/TestUtilities.swift @@ -79,10 +79,15 @@ struct TestUtilities { database: database ) + + let likes = UserLikesService( + noosphere: noosphere + ) let userProfile = UserProfileService( noosphere: noosphere, database: database, - addressBook: addressBook + addressBook: addressBook, + userLikes: likes ) let data = DataService( @@ -98,12 +103,6 @@ struct TestUtilities { noosphere: noosphere, userProfile: userProfile ) - - let likes = UserLikesService( - noosphere: noosphere, - database: database, - addressBook: addressBook - ) return DataServiceEnvironment( data: data, diff --git a/xcode/Subconscious/SubconsciousTests/Tests_CardModel.swift b/xcode/Subconscious/SubconsciousTests/Tests_CardModel.swift index 882b14dc..b88706a7 100644 --- a/xcode/Subconscious/SubconsciousTests/Tests_CardModel.swift +++ b/xcode/Subconscious/SubconsciousTests/Tests_CardModel.swift @@ -16,13 +16,15 @@ final class Tests_CardModel: XCTestCase { entry: first, author: UserProfile.dummyData(), related: [] - ) + ), + liked: false ) let second = EntryStub.dummyData() - let updated = card.update(entry: second) + let updated = card.update(entry: second, liked: true) XCTAssert(updated.entry == second) + XCTAssert(updated.liked == true) } func testUpdatePrompt() throws { @@ -33,12 +35,14 @@ final class Tests_CardModel: XCTestCase { entry: first, author: UserProfile.dummyData(), related: [] - ) + ), + liked: true ) let second = EntryStub.dummyData() - let updated = card.update(entry: second) + let updated = card.update(entry: second, liked: false) XCTAssert(updated.entry == second) + XCTAssert(updated.liked == false) } } diff --git a/xcode/Subconscious/SubconsciousTests/Tests_DataService.swift b/xcode/Subconscious/SubconsciousTests/Tests_DataService.swift index c167922d..6e2d7543 100644 --- a/xcode/Subconscious/SubconsciousTests/Tests_DataService.swift +++ b/xcode/Subconscious/SubconsciousTests/Tests_DataService.swift @@ -208,10 +208,14 @@ final class Tests_DataService: XCTestCase { noosphere: noosphere, database: database ) + let userLikes = UserLikesService( + noosphere: noosphere + ) let userProfile = UserProfileService( noosphere: noosphere, database: database, - addressBook: addressBook + addressBook: addressBook, + userLikes: userLikes ) let data = DataService( @@ -257,10 +261,14 @@ final class Tests_DataService: XCTestCase { database: database ) + let userLikes = UserLikesService( + noosphere: noosphere + ) let userProfile = UserProfileService( noosphere: noosphere, database: database, - addressBook: addressBook + addressBook: addressBook, + userLikes: userLikes ) let data = DataService( @@ -563,10 +571,14 @@ final class Tests_DataService: XCTestCase { database: database ) + let userLikes = UserLikesService( + noosphere: noosphere + ) let userProfile = UserProfileService( noosphere: noosphere, database: database, - addressBook: addressBook + addressBook: addressBook, + userLikes: userLikes ) let data = DataService(