Report a host's pinned paths among the fields an edit changed
ci / build and test (push) Successful in 4m10s
ci / android head (push) Successful in 5m32s
ci / api image (push) Failing after 18s
ci / desktop nightly (push) Successful in 2m0s

This commit is contained in:
jaap-jan committed 2026-09-28 20:50:23 +02:00
1 parent f05deb4fbc
commit a6a21decbd
3 files changed
+26 -5

No files matched your search

@@ -1,3 +1,4 @@
using DodoSSH.Client.Domain;
using DodoSSH.Contracts;
namespace DodoSSH.Client.Sync.Tests;
@@ -53,4 +54,23 @@ public sealed class ItemKindsTests
reconcilers.Keys.Order().ShouldBe(ItemKinds.SyncedTypes.Order());
}
[Fact]
public void AHostEditThatOnlyChangedItsPins_IsReportedAsChangingPinnedPaths()
{
// Pinned paths were the one host field Changes did not look at, so an edit that only pinned or
// unpinned a directory reached the keychain log as an update that changed nothing.
var before = new HostSecret
{
Label = "db-01",
Hostname = "db-01.internal",
PinnedPaths = PinnedPathList.Create(["/var/log"]),
};
var after = before with { PinnedPaths = PinnedPathList.Create(["/var/log", "/etc/nginx"]) };
HostKind.Instance.Changes(before, after).ShouldBe(["Pinned paths"]);
HostKind.Instance.Changes(before, before with { PinnedPaths = PinnedPathList.Empty })
.ShouldBe(["Pinned paths"]);
HostKind.Instance.Changes(before, before with { }).ShouldBeEmpty();
}
}