Move remote sync actions into sync menu

This commit is contained in:
Joe Julian
2026-04-06 22:30:05 -07:00
parent 7868a77c8a
commit 5d435f1f1f
2 changed files with 99 additions and 37 deletions
+49
View File
@@ -5953,6 +5953,55 @@ func TestUIRemoteSetupShortcutHasParityAcrossModes(t *testing.T) {
}
}
func TestUISyncMenuActionLabelsIncludeRemoteSetupForUnboundVault(t *testing.T) {
t.Parallel()
u := newUIWithModel("desktop", vault.Model{
Entries: []vault.Entry{{
ID: "entry-1",
Title: "Mint Console",
Path: []string{"Crew", "Signals"},
}},
})
u.state.Section = appstate.SectionEntries
got := u.syncMenuActionLabels()
if !slices.Contains(got, "Set Up Remote Sync") {
t.Fatalf("syncMenuActionLabels() = %v, want Set Up Remote Sync", got)
}
if slices.Contains(got, "Use Remote Sync") {
t.Fatalf("syncMenuActionLabels() = %v, want no Use Remote Sync without saved binding", got)
}
}
func TestUISyncMenuActionLabelsIncludeSavedRemoteActionsForBoundVault(t *testing.T) {
t.Parallel()
u := newUIWithModel("desktop", vault.Model{
Entries: []vault.Entry{{
ID: "remote-creds-1",
Title: "Bellagio WebDAV Sign-In",
Username: "linuscaldwell",
Path: []string{"Crew", "Signals"},
}},
RemoteProfiles: []vault.RemoteProfile{{
ID: "bellagio-webdav",
Name: "Bellagio Vault",
Backend: vault.RemoteBackendWebDAV,
BaseURL: "https://dav.example.invalid/remote.php/dav",
Path: "files/bellagio/keepass.kdbx",
}},
})
u.state.Section = appstate.SectionEntries
got := u.syncMenuActionLabels()
for _, want := range []string{"Use Remote Sync", "Remote Sync Settings", "Stop Using Remote Sync"} {
if !slices.Contains(got, want) {
t.Fatalf("syncMenuActionLabels() = %v, want %q", got, want)
}
}
}
func TestUIShouldHideRemoteSyncSetupShortcutWhenSavedBindingExists(t *testing.T) {
t.Parallel()