Add direct remote sync shortcut

This commit is contained in:
Joe Julian
2026-04-06 17:29:23 -07:00
parent 839cc6cc1c
commit 8b4f3f91be
2 changed files with 116 additions and 46 deletions
+46
View File
@@ -5422,6 +5422,52 @@ func TestUIOpenSelectedVaultRemoteButtonLabelUsesSavedRemoteLanguageForMultipleC
}
}
func TestUIShouldShowDirectRemoteSyncShortcutForSavedBinding(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.state.Section = appstate.SectionEntries
if !u.shouldShowDirectRemoteSyncShortcut() {
t.Fatal("shouldShowDirectRemoteSyncShortcut() = false, want true for an opened vault with a saved remote binding")
}
}
func TestUIShouldHideDirectRemoteSyncShortcutWithoutSavedBinding(t *testing.T) {
t.Parallel()
u := newUIWithModel("desktop", vault.Model{})
u.state.Section = appstate.SectionEntries
if u.shouldShowDirectRemoteSyncShortcut() {
t.Fatal("shouldShowDirectRemoteSyncShortcut() = true, want false without a saved remote binding")
}
}
func TestUIDirectRemoteSyncShortcutLabelUsesSyncLanguage(t *testing.T) {
t.Parallel()
u := newUIWithSession("desktop", &session.Manager{})
if got := u.directRemoteSyncShortcutLabel(); got != "Use Remote Sync" {
t.Fatalf("directRemoteSyncShortcutLabel() = %q, want Use Remote Sync", got)
}
}
func TestUISaveCurrentRemoteBindingActionPersistsBindingIntoVault(t *testing.T) {
t.Parallel()