feat(ui): ssh workspaces as quick-session targets in mission control
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Linq;
|
||||
using ClaudeDo.Data;
|
||||
using ClaudeDo.Data.Models;
|
||||
using ClaudeDo.Data.Repositories;
|
||||
using ClaudeDo.Ui.Services;
|
||||
using ClaudeDo.Ui.ViewModels;
|
||||
using ClaudeDo.Ui.ViewModels.MissionControl;
|
||||
@@ -303,6 +304,28 @@ public class MissionControlViewModelTests : IDisposable
|
||||
Assert.True(vm.Queued[4].CanOpenSession);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task RefreshSessionTargetsAsync_AppendsSshWorkspaces_AndStartsSshPane()
|
||||
{
|
||||
await using (var db = NewContext())
|
||||
{
|
||||
db.Lists.Add(new ListEntity { Id = "L1", Name = "Alpha", WorkingDir = @"C:\repos\alpha", CreatedAt = DateTime.UtcNow });
|
||||
await db.SaveChangesAsync();
|
||||
await new AppSettingsRepository(db).SetSshWorkspacesAsync([new SshWorkspace("w1", "VPS", "vps", "/srv/app")]);
|
||||
}
|
||||
|
||||
using var vm = BuildVm(new FakeWorker());
|
||||
|
||||
await vm.RefreshSessionTargetsAsync();
|
||||
|
||||
Assert.Equal(4, vm.SessionTargets.Count); // home, browse, Alpha, VPS
|
||||
Assert.Contains("VPS", vm.SessionTargets[3].Label);
|
||||
|
||||
vm.SessionTargets[3].StartCommand.Execute(null);
|
||||
var pane = Assert.Single(vm.ConPtySessions);
|
||||
Assert.Equal("VPS", pane.DisplayTitle);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task RefreshSessionTargetsAsync_ListsWithWorkingDir_PlusBrowse()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user