From 419295647bc8e67c1a30c85b4213161ca53cfdc3 Mon Sep 17 00:00:00 2001 From: MinHeokChoi Date: Tue, 1 Sep 2026 15:55:33 +0900 Subject: [PATCH] fix: update stale delete/active-selection dependency test for productionP0 PR #207 added .atomicSingleActive to productionP0, so setRoutineGroupActive is now supported in production and a pending active-selection mutation must settle before that group's delete is admitted. The old test still asserted the pre-#207 behavior (delete ignores the pending selection) and failed. Rewrote it to assert the current, correct ordering. --- Moru/MoruTests/RoutineSyncFoundationTests.swift | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Moru/MoruTests/RoutineSyncFoundationTests.swift b/Moru/MoruTests/RoutineSyncFoundationTests.swift index a2665f32..3d390701 100644 --- a/Moru/MoruTests/RoutineSyncFoundationTests.swift +++ b/Moru/MoruTests/RoutineSyncFoundationTests.swift @@ -2019,7 +2019,12 @@ final class RoutineSyncFoundationTests: XCTestCase { } @MainActor - func testProductionDeleteIgnoresUnsupportedActiveIntentDependency() throws { + func testProductionDeleteWaitsForPendingActiveSelectionUnderAtomicSingleActive() throws { + // productionP0 now includes .atomicSingleActive (see PR #207), so + // setRoutineGroupActive is supported in production and a pending + // active-selection mutation for a group must settle before that group's + // delete is admitted, per dependenciesAreSatisfied's .deleteRoutineGroup + // handling of .selectActiveRoutineGroup dependents. let repository = try makeRepository() let groupID = UUID() _ = try repository.recordRemoteID( @@ -2047,9 +2052,9 @@ final class RoutineSyncFoundationTests: XCTestCase { at: Date(timeIntervalSince1970: 4) ) - XCTAssertEqual(admitted.map(\.id), [delete.id]) + XCTAssertEqual(admitted.map(\.id), [active.id]) XCTAssertEqual( - try repository.mutations(memberID: 7).first { $0.id == active.id }?.state, + try repository.mutations(memberID: 7).first { $0.id == delete.id }?.state, .waitingForServerContract ) }