feat(ui): external services tab with Azure DevOps PAT, draft PR button and link in company repos
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user