LocalData/Tests/LocalDataTests/SyncHelperExpansionTests.swift
Matt Bruce 66001439e3 Update Configuration, Helpers, Models (+1 more) + tests
Summary:
- Sources: Configuration, Helpers, Models, Services
- Tests: AppGroupTests.swift, FileStorageHelperExpansionTests.swift, FileStorageHelperTests.swift, MigrationTests.swift, RouterConfigurationTests.swift (+5 more)
- Added symbols: func resolveDirectoryURL, func handleReceivedContext, enum KeychainAccessControl, enum KeychainAccessibility, enum SecurityPolicy, enum EncryptionPolicy (+5 more)
- Removed symbols: func resolveDirectoryURL, func handleReceivedContext, enum KeychainAccessControl, enum KeychainAccessibility, enum SecurityPolicy, enum EncryptionPolicy (+1 more)

Stats:
- 18 files changed, 306 insertions(+), 58 deletions(-)
2026-01-18 14:53:29 -06:00

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
}
}