- SnapshotModels.swift: CachedQuote (slug-unique, themes/regions
als CSV), SnapshotMeta (singleton mit lastSyncedAt + totalCount),
SnapshotContainer.make() mit App-Group-Store-URL (Fallback auf
App-Container für Dev ohne Apple-Dev-Portal-Setup)
- SnapshotSync (actor) mit injectable Loader für Tests: refresh /
refreshIfStale / tryRefresh (fail-soft). Re-konsolidiert beim Pull
(Update + Insert + Delete entzogene Slugs). 24h-Staleness-Default.
- DailyQuoteWidget: Hash-of-Day-Picker aus SwiftData, drei Sizes,
Mitternacht-Refresh-Policy, Placeholder bei leerem Store. Widget-
Target zieht SnapshotModels.swift mit (project.yml).
- ZitareNativeApp triggert SnapshotSync.tryRefresh() bei Launch +
WidgetCenter.reloadAllTimelines() danach.
- AppConfig.snapshotURL = webBaseURL/index-min.json (Web-Endpoint
noch nicht live, fail-soft).
- DeepLinkRouter Substring-Guard fix (`/t` statt `/t/` im
Prefix-Array, sonst greift hasPrefix("/t//") nicht).
- 22 Tests grün (6 AppConfig + 11 DeepLinkRouter + 3 SnapshotSync +
1 UI + 1 Widget-Compile-Smoke), swiftlint 0 violations in 22 Files
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
39 lines
1.4 KiB
Swift
39 lines
1.4 KiB
Swift
import XCTest
|
|
@testable import ZitareNative
|
|
|
|
/// Phase ζ-0 Basis-Tests: Konfigurations-Konstanten sind konsistent
|
|
/// mit dem mana-Plattform-Setup (Bundle-ID, Keychain-Service,
|
|
/// Endpoint-Domains).
|
|
final class AppConfigTests: XCTestCase {
|
|
func test_authBaseURL_pointsToManaAuth() {
|
|
XCTAssertEqual(
|
|
AppConfig.manaAppConfig.authBaseURL.absoluteString,
|
|
"https://auth.mana.how"
|
|
)
|
|
}
|
|
|
|
func test_keychainService_matchesBundle() {
|
|
XCTAssertEqual(AppConfig.manaAppConfig.keychainService, "ev.mana.zitare")
|
|
}
|
|
|
|
func test_apiBaseURL_pointsToZitareApi() {
|
|
XCTAssertEqual(AppConfig.apiBaseURL.absoluteString, "https://zitare-api.mana.how")
|
|
}
|
|
|
|
func test_webBaseURL_currentDefault() {
|
|
// Übergang: zitare.com hat noch keinen DNS-Record (Cloudflare-Zone-
|
|
// Onboarding offen), deshalb fällt webBaseURL aktuell auf
|
|
// appBaseURL zurück. Nach Cloudflare-Cut wird das wieder
|
|
// publicWebURL — Test dann anpassen.
|
|
XCTAssertEqual(AppConfig.webBaseURL.absoluteString, "https://zitare.mana.how")
|
|
XCTAssertEqual(AppConfig.publicWebURL.absoluteString, "https://zitare.com")
|
|
}
|
|
|
|
func test_appBaseURL_isManaHowSurface() {
|
|
XCTAssertEqual(AppConfig.appBaseURL.absoluteString, "https://zitare.mana.how")
|
|
}
|
|
|
|
func test_appGroup_matchesEntitlement() {
|
|
XCTAssertEqual(AppConfig.appGroup, "group.ev.mana.zitare")
|
|
}
|
|
}
|