|
|
|
|
@ -36,4 +36,39 @@ final class UserDataTests: XCTestCase { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func login() async throws -> User { |
|
|
|
|
let user: User = try await Store.main.service().login(username: self.username, password: self.password) |
|
|
|
|
return user |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func testUserUpdate() async throws { |
|
|
|
|
|
|
|
|
|
let user = try await self.login() |
|
|
|
|
|
|
|
|
|
user.summonsMessageBody = "hello" |
|
|
|
|
user.summonsMessageSignature = "jean coco" |
|
|
|
|
user.summonsAvailablePaymentMethods = "cash" |
|
|
|
|
user.summonsDisplayFormat = true |
|
|
|
|
user.summonsDisplayEntryFee = true |
|
|
|
|
user.summonsUseFullCustomMessage = true |
|
|
|
|
user.matchFormatsDefaultDuration = [MatchFormat.nineGames : 1] |
|
|
|
|
user.bracketMatchFormatPreference = MatchFormat.superTie |
|
|
|
|
user.groupStageMatchFormatPreference = MatchFormat.twoSets |
|
|
|
|
user.loserBracketMatchFormatPreference = MatchFormat.twoSetsOfFourGames |
|
|
|
|
|
|
|
|
|
let uu = try await Store.main.service().put(user) |
|
|
|
|
|
|
|
|
|
assert(uu.summonsMessageBody == user.summonsMessageBody) |
|
|
|
|
assert(uu.summonsMessageSignature == user.summonsMessageSignature) |
|
|
|
|
assert(uu.summonsAvailablePaymentMethods == user.summonsAvailablePaymentMethods) |
|
|
|
|
assert(uu.summonsDisplayFormat == user.summonsDisplayFormat) |
|
|
|
|
assert(uu.summonsDisplayEntryFee == user.summonsDisplayEntryFee) |
|
|
|
|
assert(uu.summonsUseFullCustomMessage == user.summonsUseFullCustomMessage) |
|
|
|
|
assert(uu.matchFormatsDefaultDuration == user.matchFormatsDefaultDuration) |
|
|
|
|
assert(uu.bracketMatchFormatPreference == user.bracketMatchFormatPreference) |
|
|
|
|
assert(uu.groupStageMatchFormatPreference == user.groupStageMatchFormatPreference) |
|
|
|
|
assert(uu.loserBracketMatchFormatPreference == user.loserBracketMatchFormatPreference) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|