feat: add Atlas native app UX overhaul

This commit is contained in:
zhukang
2026-03-10 17:09:35 +08:00
parent 0fabc6feec
commit 994e63f0b3
199 changed files with 38705 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
import XCTest
@testable import AtlasDomain
final class AtlasDomainTests: XCTestCase {
override func setUp() {
super.setUp()
AtlasL10n.setCurrentLanguage(.zhHans)
}
func testPrimaryRoutesMatchFrozenMVP() {
XCTAssertEqual(
AtlasRoute.allCases.map(\.title),
["概览", "智能清理", "应用", "历史", "权限", "设置"]
)
}
func testScaffoldFixturesExposeRecoveryItems() {
XCTAssertFalse(AtlasScaffoldFixtures.recoveryItems.isEmpty)
XCTAssertGreaterThan(AtlasScaffoldFixtures.findings.map(\.bytes).reduce(0, +), 0)
}
func testSettingsDecodeDefaultsLanguageToChineseWhenMissing() throws {
let data = Data("""
{
"recoveryRetentionDays": 7,
"notificationsEnabled": true,
"excludedPaths": []
}
""".utf8)
let settings = try JSONDecoder().decode(AtlasSettings.self, from: data)
XCTAssertEqual(settings.language, .zhHans)
XCTAssertEqual(settings.acknowledgementText, AtlasL10n.acknowledgement(language: .zhHans))
}
func testOnlyFullDiskAccessIsRequiredForCurrentWorkflows() {
XCTAssertTrue(PermissionKind.fullDiskAccess.isRequiredForCurrentWorkflows)
XCTAssertFalse(PermissionKind.accessibility.isRequiredForCurrentWorkflows)
XCTAssertFalse(PermissionKind.notifications.isRequiredForCurrentWorkflows)
}
}