//
//  SynchronizationTests.swift
//  PadelClubTests
//
//  Created by Laurent Morvillier on 09/10/2024.
//

import Testing
import LeStorage
@testable import PadelClub

struct SynchronizationTests {
    
    let username: String = "laurent"
    let password: String = "StaxKikoo12"
    
    init() {
        StoreCenter.main.configureURLs(secureScheme: false, domain: "127.0.0.1:8000")
    }
    
    @Test func synchronizationTest() async throws {

        _ = try await self.login()
        try await StoreCenter.main.synchronizeLastUpdates()

    }
    
    func login() async throws -> CustomUser {
        let user: CustomUser = try await StoreCenter.main.service().login(username: self.username, password: self.password)
        return user
    }

}
