Public Access
Report a host's pinned paths among the fields an edit changed
This commit is contained in:
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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user