using System; using System.Collections.Generic; using System.Threading.Tasks; using ClaudeDo.Ui.Services; using ClaudeDo.Ui.ViewModels.MissionControl; using Xunit; namespace ClaudeDo.Ui.Tests; public class MissionControlViewModelTests { [Fact] public void DeferredHandoffUpdatesConPtyPaneTitleWithResetTime() { var taskId = Guid.NewGuid().ToString(); var title = "Test Handler"; var dueAt = new DateTimeOffset(2026, 9, 10, 14, 30, 0, TimeSpan.Zero); var pane = new ConPtyPaneViewModel(taskId, title, () => Task.FromResult( new TerminalLaunchDescriptor(".", "claude", Array.Empty(), new Dictionary()))); var originalTitle = pane.DisplayTitle; // Simulate the update that would happen on HandlerHandoffDeferredEvent var suffix = $"waiting for limit reset ({dueAt.LocalDateTime:HH:mm})"; pane.DisplayTitle += $" — {suffix}"; Assert.NotEqual(originalTitle, pane.DisplayTitle); Assert.Contains("waiting for limit reset", pane.DisplayTitle); Assert.Contains(dueAt.LocalDateTime.ToString("HH:mm"), pane.DisplayTitle); } }