Summary: - Sources: update Configuration, Helpers, Models (+1 more) - Tests: update tests for AppGroupTests.swift, FileStorageHelperExpansionTests.swift, FileStorageHelperTests.swift (+7 more) Stats: - 18 files changed, 306 insertions(+), 58 deletions(-)
32 lines
1.1 KiB
Swift
32 lines
1.1 KiB
Swift
import Foundation
|
|
import Testing
|
|
@testable import LocalData
|
|
|
|
@Suite struct SyncHelperExpansionTests {
|
|
private let helper = SyncHelper()
|
|
|
|
@Test func handleReceivedContextProcessing() async throws {
|
|
let key = "received.key"
|
|
let value = Data("received.data".utf8)
|
|
let context: [String: Any] = [key: value, "invalid": "not-data"]
|
|
|
|
// This exercises the loop and the data casting
|
|
await helper.handleReceivedContext(context)
|
|
}
|
|
|
|
@Test func manualSyncExercisesPerformSync() async throws {
|
|
let data = Data("manual-sync-data".utf8)
|
|
|
|
// This will likely return early in most test environments due to WCSession state,
|
|
// but it exercises the public entry point.
|
|
try await helper.manualSync(data: data, keyName: "manual.key")
|
|
}
|
|
|
|
@Test func currentContextReturnsEmptyIfNotSupported() async throws {
|
|
// This exercises the guard in currentContext()
|
|
let context = await helper.currentContext()
|
|
// WCSession might or might not be supported, but this hits the line
|
|
let _ = context.count
|
|
}
|
|
}
|