Show sync mode in saved remote summary

This commit is contained in:
Joe Julian
2026-04-06 20:55:46 -07:00
parent 84512172f3
commit 60172d8c6d
2 changed files with 48 additions and 6 deletions
+33 -1
View File
@@ -5692,7 +5692,7 @@ func TestUISavedRemoteBindingSummaryUsesImplicitSingleChoice(t *testing.T) {
}},
})
profileLabel, credentialLabel, ok := u.savedRemoteBindingSummary()
profileLabel, credentialLabel, syncLabel, ok := u.savedRemoteBindingSummary()
if !ok {
t.Fatal("savedRemoteBindingSummary() ok = false, want true")
}
@@ -5702,6 +5702,38 @@ func TestUISavedRemoteBindingSummaryUsesImplicitSingleChoice(t *testing.T) {
if credentialLabel != "WebDAV Sign-In · tjulian" {
t.Fatalf("credentialLabel = %q, want WebDAV Sign-In · tjulian", credentialLabel)
}
if syncLabel != "Sync manually when you choose Use Remote Sync." {
t.Fatalf("syncLabel = %q, want manual sync summary", syncLabel)
}
}
func TestUISavedRemoteBindingSummaryMentionsAutomaticSyncMode(t *testing.T) {
t.Parallel()
u := newUIWithModel("desktop", vault.Model{
Entries: []vault.Entry{{
ID: "remote-creds-1",
Title: "WebDAV Sign-In",
Username: "tjulian",
Path: []string{"Crew", "Internet"},
}},
RemoteProfiles: []vault.RemoteProfile{{
ID: "family-webdav",
Name: "Family Vault",
Backend: vault.RemoteBackendWebDAV,
BaseURL: "https://dav.example.invalid/remote.php/dav",
Path: "files/family/keepass.kdbx",
}},
})
u.selectedVaultRemoteSyncMode = appstate.SyncModeAutomaticOnOpenSave
_, _, syncLabel, ok := u.savedRemoteBindingSummary()
if !ok {
t.Fatal("savedRemoteBindingSummary() ok = false, want true")
}
if syncLabel != "Syncs automatically on open and save." {
t.Fatalf("syncLabel = %q, want automatic sync summary", syncLabel)
}
}
func TestUISavedRemoteBindingHeadingUsesSyncLanguageForSingleChoice(t *testing.T) {