diff --git a/PadelClub/Views/Tournament/Subscription/Guard.swift b/PadelClub/Views/Tournament/Subscription/Guard.swift index e2a03ec..afbc3b6 100644 --- a/PadelClub/Views/Tournament/Subscription/Guard.swift +++ b/PadelClub/Views/Tournament/Subscription/Guard.swift @@ -143,6 +143,7 @@ import LeStorage purchase.revocationDate = transaction.revocationDate purchase.expirationDate = transaction.expirationDate purchase.purchaseDate = transaction.purchaseDate + purchase.productId = transaction.productID try purchases.addOrUpdate(instance: purchase) } else { let purchase: Purchase = try transaction.purchase() diff --git a/PadelClubTests/ServerDataTests.swift b/PadelClubTests/ServerDataTests.swift index 2643987..15e26b6 100644 --- a/PadelClubTests/ServerDataTests.swift +++ b/PadelClubTests/ServerDataTests.swift @@ -11,7 +11,7 @@ import LeStorage final class ServerDataTests: XCTestCase { - let username: String = "test" + let username: String = "UserDataTests" let password: String = "MyPass1234--" override func setUpWithError() throws { @@ -68,7 +68,7 @@ final class ServerDataTests: XCTestCase { func testLogin() async throws { let user: User = try await StoreCenter.main.service().login(username: self.username, password: self.password) - assert(user.username == "test") + assert(user.username == self.username) } func testEvent() async throws { diff --git a/PadelClubTests/UserDataTests.swift b/PadelClubTests/UserDataTests.swift index 4980845..c7f7fd6 100644 --- a/PadelClubTests/UserDataTests.swift +++ b/PadelClubTests/UserDataTests.swift @@ -11,7 +11,7 @@ import LeStorage final class UserDataTests: XCTestCase { - let username: String = "test" + let username: String = "UserDataTests" let password: String = "MyPass1234--" override func setUpWithError() throws { @@ -24,7 +24,7 @@ final class UserDataTests: XCTestCase { func testUserCreation() async throws { - let userCreationForm = UserCreationForm(user: User.placeHolder(), username: self.username, password: self.password, firstName: "jean", lastName: "coco", email: "test@lolomo.com", phone: "0123", country: "France") + let userCreationForm = UserCreationForm(user: User.placeHolder(), username: self.username, password: self.password, firstName: "jean", lastName: "coco", email: "UserDataTests@lolomo.net", phone: "0123", country: "France") let user: User = try await StoreCenter.main.service().createAccount(user: userCreationForm) assert(user.username == userCreationForm.username) @@ -41,6 +41,10 @@ final class UserDataTests: XCTestCase { return user } + func testLogin() async throws { + let _ = try await self.login() + } + func testUserUpdate() async throws { let user = try await self.login()