feat(ui): external services tab with Azure DevOps PAT, draft PR button and link in company repos

This commit is contained in:
mika kuns
2026-10-01 12:13:57 +02:00
parent fed0b6ac51
commit 4976ded7ae
9 changed files with 247 additions and 15 deletions
@@ -0,0 +1,46 @@
using ClaudeDo.Ui.ViewModels.Islands;
using Xunit;
namespace ClaudeDo.Ui.Tests.ViewModels;
/// <summary>Detail pane in a company repo: approve becomes "create draft PR" / "update PR", and the PR link only exists once there is a PR.</summary>
public sealed class MergeSectionCompanyRepoTests
{
private sealed class Worker : StubWorkerClient { }
private static MergeSectionViewModel Vm() => new(new Worker(), services: null!);
[Fact]
public void PrivateRepo_ShowsOnlyApproveAndMerge()
{
var vm = Vm();
Assert.True(vm.ShowApproveMerge);
Assert.False(vm.ShowCreatePr);
Assert.False(vm.ShowUpdatePr);
Assert.False(vm.OpenPullRequestCommand.CanExecute(null));
}
[Fact]
public void CompanyRepo_WithoutPr_OffersCreateDraftPr()
{
var vm = Vm();
vm.IsCompanyRepo = true;
Assert.False(vm.ShowApproveMerge);
Assert.True(vm.ShowCreatePr);
Assert.False(vm.ShowUpdatePr);
}
[Fact]
public void CompanyRepo_WithPr_OffersUpdateAndLink()
{
var vm = Vm();
vm.IsCompanyRepo = true;
vm.PullRequestUrl = "https://srv/Coll/Proj/_git/Repo/pullrequest/5";
Assert.False(vm.ShowCreatePr);
Assert.True(vm.ShowUpdatePr);
Assert.True(vm.OpenPullRequestCommand.CanExecute(null));
}
}