refactor(ui): unify list-linked-repo predicate into RepoLinkage
ListsIslandViewModel and SettingsModalViewModel each re-implemented "does this list have a linked WorkingDir" with different whitespace handling. RepoLinkage.IsLinked/IsLinkedInDb is now the single definition; both callers derive from it, closing the whitespace-only WorkingDir gap where the Settings modal disagreed with the ListsIsland banner.
This commit is contained in:
@@ -167,6 +167,21 @@ public class SettingsModalViewModelTests : IDisposable
|
||||
Assert.True(vm.HasLinkedRepo);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task HasLinkedRepo_false_when_a_list_working_dir_is_whitespace_only()
|
||||
{
|
||||
using (var ctx = NewContext())
|
||||
{
|
||||
ctx.Lists.Add(new ListEntity { Id = "l1", Name = "Blank repo", CreatedAt = DateTime.UtcNow, WorkingDir = " " });
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
var vm = MakeVm(new FakeWorker());
|
||||
|
||||
await vm.LoadAsync();
|
||||
|
||||
Assert.False(vm.HasLinkedRepo);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SelectedCategory_updates_SelectedIndex_and_ignores_null()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user