Add direct remote sync shortcut
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user