Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Moru/MoruTests/RoutineSyncFoundationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
)
}
Expand Down
Loading