diff --git a/tests/ClaudeDo.Ui.Tests/StubWorkerClient.cs b/tests/ClaudeDo.Ui.Tests/StubWorkerClient.cs index 19ef5b77..6d6f5b1e 100644 --- a/tests/ClaudeDo.Ui.Tests/StubWorkerClient.cs +++ b/tests/ClaudeDo.Ui.Tests/StubWorkerClient.cs @@ -183,6 +183,17 @@ public abstract class StubWorkerClient : IWorkerClient => Task.FromResult>(Array.Empty()); public virtual Task> GetTaskUsageAsync(DateOnly from, DateOnly to) => Task.FromResult>(Array.Empty()); + + // "Not installed, but Node is fine" — the state that exercises the hint card and the + // install button without ever touching a real CLI. + public virtual Task GetTokenTrackerStatusAsync() => + Task.FromResult(new TokenTrackerStatusDto( + Installed: false, Version: null, NodeOk: true, NodeVersion: "v22.0.0", + LastFetchedUtc: null, LastError: null, FormatVersion: null, SessionCount: 0)); + + public virtual Task RefreshTokenTrackerAsync() => GetTokenTrackerStatusAsync(); + + public virtual Task InstallTokenTrackerAsync() => GetTokenTrackerStatusAsync(); public void RaiseUsageUpdated(UsageSnapshotDto snapshot) => UsageUpdatedEvent?.Invoke(snapshot); protected void RaisePropertyChanged(string name) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); diff --git a/tests/ClaudeDo.Worker.Tests/UiVm/TasksIslandViewModelPlanningTests.cs b/tests/ClaudeDo.Worker.Tests/UiVm/TasksIslandViewModelPlanningTests.cs index 2b0d2878..7210719b 100644 --- a/tests/ClaudeDo.Worker.Tests/UiVm/TasksIslandViewModelPlanningTests.cs +++ b/tests/ClaudeDo.Worker.Tests/UiVm/TasksIslandViewModelPlanningTests.cs @@ -171,6 +171,15 @@ sealed class FakeWorkerClient : IWorkerClient => Task.FromResult>(System.Array.Empty()); public Task> GetTaskUsageAsync(DateOnly from, DateOnly to) => Task.FromResult>(System.Array.Empty()); + + public Task GetTokenTrackerStatusAsync() => + Task.FromResult(new TokenTrackerStatusDto( + Installed: false, Version: null, NodeOk: true, NodeVersion: "v22.0.0", + LastFetchedUtc: null, LastError: null, FormatVersion: null, SessionCount: 0)); + + public Task RefreshTokenTrackerAsync() => GetTokenTrackerStatusAsync(); + + public Task InstallTokenTrackerAsync() => GetTokenTrackerStatusAsync(); } // ── Helper to build VM with pre-seeded Items ──────────────────────────────────