Merge branch 'main'

online_reg
Raz 10 months ago
commit 1bbd981097
  1. 1
      PadelClub/Views/Tournament/Subscription/Guard.swift
  2. 4
      PadelClubTests/ServerDataTests.swift
  3. 8
      PadelClubTests/UserDataTests.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()

@ -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 {

@ -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()

Loading…
Cancel
Save