|
|
|
|
@ -52,7 +52,7 @@ struct SynchronizationTests { |
|
|
|
|
let _: CustomUser = try await storeCenter.service().login(username: self.username, password: self.password) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test("device id tests") |
|
|
|
|
@Test |
|
|
|
|
func testDeviceIds() async throws { |
|
|
|
|
#expect(StoreCenter.main.deviceId() != self.secondStoreCenter.deviceId()) |
|
|
|
|
} |
|
|
|
|
@ -69,12 +69,12 @@ struct SynchronizationTests { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Cleanup |
|
|
|
|
let eventCollection1: SyncedCollection<Event> = await StoreCenter.main.mainStore.synchronizedCollectionWithFileLoading() |
|
|
|
|
let eventCollection1: SyncedCollection<Event> = await StoreCenter.main.mainStore.asyncLoadingSynchronizedCollection() |
|
|
|
|
#expect(eventCollection1.hasLoaded == true) |
|
|
|
|
|
|
|
|
|
await eventCollection1.deleteAsync(contentOfs: Array(eventCollection1)) |
|
|
|
|
|
|
|
|
|
let eventCollection2: SyncedCollection<Event> = await self.secondStoreCenter.mainStore.synchronizedCollectionWithFileLoading() |
|
|
|
|
let eventCollection2: SyncedCollection<Event> = await self.secondStoreCenter.mainStore.asyncLoadingSynchronizedCollection() |
|
|
|
|
#expect(eventCollection2.hasLoaded == true) |
|
|
|
|
eventCollection2.clear() |
|
|
|
|
|
|
|
|
|
@ -114,15 +114,15 @@ struct SynchronizationTests { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Setup events collections |
|
|
|
|
let eventCollectionA: SyncedCollection<Event> = await StoreCenter.main.mainStore.synchronizedCollectionWithFileLoading() |
|
|
|
|
let eventCollectionA: SyncedCollection<Event> = await StoreCenter.main.mainStore.asyncLoadingSynchronizedCollection() |
|
|
|
|
await eventCollectionA.deleteAsync(contentOfs: Array(eventCollectionA)) |
|
|
|
|
let eventCollectionB: SyncedCollection<Event> = await self.secondStoreCenter.mainStore.synchronizedCollectionWithFileLoading() |
|
|
|
|
let eventCollectionB: SyncedCollection<Event> = await self.secondStoreCenter.mainStore.asyncLoadingSynchronizedCollection() |
|
|
|
|
eventCollectionB.clear() |
|
|
|
|
|
|
|
|
|
// Setup clubs collections |
|
|
|
|
let clubCollectionA: SyncedCollection<Club> = await StoreCenter.main.mainStore.synchronizedCollectionWithFileLoading() |
|
|
|
|
let clubCollectionA: SyncedCollection<Club> = await StoreCenter.main.mainStore.asyncLoadingSynchronizedCollection() |
|
|
|
|
await clubCollectionA.deleteAsync(contentOfs: Array(clubCollectionA)) |
|
|
|
|
let clubCollectionB: SyncedCollection<Club> = await self.secondStoreCenter.mainStore.synchronizedCollectionWithFileLoading() |
|
|
|
|
let clubCollectionB: SyncedCollection<Club> = await self.secondStoreCenter.mainStore.asyncLoadingSynchronizedCollection() |
|
|
|
|
clubCollectionB.clear() |
|
|
|
|
|
|
|
|
|
// cleanup sync residues |
|
|
|
|
@ -178,9 +178,9 @@ struct SynchronizationTests { |
|
|
|
|
let tournament = Tournament() |
|
|
|
|
|
|
|
|
|
// Setup TeamReg |
|
|
|
|
let teamRegColA: SyncedCollection<TeamRegistration> = await StoreCenter.main.mainStore.synchronizedCollectionWithFileLoading() |
|
|
|
|
let teamRegColA: SyncedCollection<TeamRegistration> = await StoreCenter.main.mainStore.asyncLoadingSynchronizedCollection() |
|
|
|
|
await teamRegColA.deleteAsync(contentOfs: Array(teamRegColA)) |
|
|
|
|
let teamRegColB: SyncedCollection<TeamRegistration> = await self.secondStoreCenter.mainStore.synchronizedCollectionWithFileLoading() |
|
|
|
|
let teamRegColB: SyncedCollection<TeamRegistration> = await self.secondStoreCenter.mainStore.asyncLoadingSynchronizedCollection() |
|
|
|
|
teamRegColB.clear() |
|
|
|
|
|
|
|
|
|
// cleanup sync residues |
|
|
|
|
@ -204,9 +204,9 @@ struct SynchronizationTests { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Setup events collections |
|
|
|
|
let eventCollectionA: SyncedCollection<Event> = await StoreCenter.main.mainStore.synchronizedCollectionWithFileLoading() |
|
|
|
|
let eventCollectionA: SyncedCollection<Event> = await StoreCenter.main.mainStore.asyncLoadingSynchronizedCollection() |
|
|
|
|
await eventCollectionA.deleteAsync(contentOfs: Array(eventCollectionA)) |
|
|
|
|
let eventCollectionB: SyncedCollection<Event> = await self.secondStoreCenter.mainStore.synchronizedCollectionWithFileLoading() |
|
|
|
|
let eventCollectionB: SyncedCollection<Event> = await self.secondStoreCenter.mainStore.asyncLoadingSynchronizedCollection() |
|
|
|
|
eventCollectionB.clear() |
|
|
|
|
|
|
|
|
|
// cleanup sync residues |
|
|
|
|
|