diff --git a/MyPassCore/Tests/MyPassCoreTests/GroupSelectionTests.swift b/MyPassCore/Tests/MyPassCoreTests/GroupSelectionTests.swift index b5c5a84..ded5ef2 100644 --- a/MyPassCore/Tests/MyPassCoreTests/GroupSelectionTests.swift +++ b/MyPassCore/Tests/MyPassCoreTests/GroupSelectionTests.swift @@ -39,4 +39,19 @@ final class GroupSelectionTests: XCTestCase { let result = GroupSelection.toggling(work.id, in: root, current: [personal.id]) XCTAssertEqual(result, [personal.id, work.id, email.id]) } + + func test_subtreeIds_groupNotFound_returnsEmptySet() { + let (root, _, _, _) = makeSampleTree() + let nonExistentId = UUID() + let ids = GroupSelection.subtreeIds(of: nonExistentId, in: root) + XCTAssertEqual(ids, []) + } + + func test_toggling_groupNotFound_returnsCurrentUnchanged() { + let (root, _, _, personal) = makeSampleTree() + let nonExistentId = UUID() + let current: Set = [personal.id] + let result = GroupSelection.toggling(nonExistentId, in: root, current: current) + XCTAssertEqual(result, current) + } }