- Custom copper AccentColor and warm VaultBackground color assets (light/dark), applied to both the main app and the AutoFill extension (which needed its own copy of the asset catalog plus ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME and an explicit .tint() modifier, since extensions don't pick up the app-wide accent color the same way a full SwiftUI App/Scene does). - GroupFilterView no longer uses DisclosureGroup for subgroups -- the whole tree renders always-expanded (indented per depth) so active filters are visible at a glance instead of requiring tap-to-expand. - Added a placeholder app icon (padlock glyph, light/dark/tinted variants plus macOS sizes) -- previously the icon slot existed but had no actual images, which blocks App Store/TestFlight archive validation. - Added ITSAppUsesNonExemptEncryption = NO (standard encryption only, via KeePassKit) to skip the export-compliance prompt on each upload. - Renamed the app from MyPass to KeeVault throughout: Xcode project/targets/ schemes, the MyPassCore package (now KeeVaultCore) and every import site, folder and file names, bundle identifiers (org.antiloop222.keevault) and their App Group/Keychain-group entitlements, and remaining UI/string references -- MyPass was already taken as an App Store app name.
53 lines
2.2 KiB
Swift
53 lines
2.2 KiB
Swift
import XCTest
|
|
@testable import KeeVaultCore
|
|
|
|
final class GroupTreeTests: XCTestCase {
|
|
private func makeSampleTree() -> (root: Group, work: Group, email: Group) {
|
|
let supportEntry = Entry(title: "Support Login", username: "alice")
|
|
let email = Group(name: "Email", entries: [supportEntry])
|
|
let bankEntry = Entry(title: "Bank", username: "bob")
|
|
let work = Group(name: "Work", subgroups: [email], entries: [bankEntry])
|
|
let rootEntry = Entry(title: "Root Entry", username: "root-user")
|
|
let root = Group(name: "Root", subgroups: [work], entries: [rootEntry])
|
|
return (root, work, email)
|
|
}
|
|
|
|
func test_flattenEntries_rootEntry_hasEmptyBreadcrumb() {
|
|
let (root, _, _) = makeSampleTree()
|
|
let flat = flattenEntries(in: root)
|
|
let rootEntry = flat.first { $0.entry.title == "Root Entry" }
|
|
XCTAssertEqual(rootEntry?.breadcrumb, [])
|
|
XCTAssertEqual(rootEntry?.parentGroupId, root.id)
|
|
}
|
|
|
|
func test_flattenEntries_directChildEntry_hasSingleGroupBreadcrumb() {
|
|
let (root, work, _) = makeSampleTree()
|
|
let flat = flattenEntries(in: root)
|
|
let bankEntry = flat.first { $0.entry.title == "Bank" }
|
|
XCTAssertEqual(bankEntry?.breadcrumb.map(\.name), ["Work"])
|
|
XCTAssertEqual(bankEntry?.parentGroupId, work.id)
|
|
}
|
|
|
|
func test_flattenEntries_nestedEntry_hasFullBreadcrumb() {
|
|
let (root, _, email) = makeSampleTree()
|
|
let flat = flattenEntries(in: root)
|
|
let supportEntry = flat.first { $0.entry.title == "Support Login" }
|
|
XCTAssertEqual(supportEntry?.breadcrumb.map(\.name), ["Work", "Email"])
|
|
XCTAssertEqual(supportEntry?.parentGroupId, email.id)
|
|
}
|
|
|
|
func test_flattenGroups_includesRootFirstWithEmptyBreadcrumb() {
|
|
let (root, _, _) = makeSampleTree()
|
|
let flat = flattenGroups(in: root)
|
|
XCTAssertEqual(flat.first?.group.id, root.id)
|
|
XCTAssertEqual(flat.first?.breadcrumb, [])
|
|
}
|
|
|
|
func test_flattenGroups_nestedGroup_hasBreadcrumb() {
|
|
let (root, _, _) = makeSampleTree()
|
|
let flat = flattenGroups(in: root)
|
|
let email = flat.first { $0.group.name == "Email" }
|
|
XCTAssertEqual(email?.breadcrumb.map(\.name), ["Work"])
|
|
}
|
|
}
|