Move remote preference help out of open flow

This commit is contained in:
Joe Julian
2026-04-01 17:37:06 -07:00
parent b3447a42df
commit 2677f7db17
3 changed files with 135 additions and 18 deletions
+45 -9
View File
@@ -3600,25 +3600,25 @@ func TestRecentRemoteStoredAuthSummaryDescribesSavedCredentialState(t *testing.T
}
}
func TestUIRemoteAuthStatusMessageExplainsWhatWillBeRemembered(t *testing.T) {
func TestUIRemotePreferencesCurrentSummaryExplainsWhatWillBeRemembered(t *testing.T) {
t.Parallel()
u := newUIWithSession("desktop", &session.Manager{})
u.remoteBaseURL.SetText("https://dav.example.com")
u.remotePath.SetText("vaults/home.kdbx")
if got := u.remoteAuthStatusMessage(); got != "Only the location will be saved in Recent Connections." {
t.Fatalf("remoteAuthStatusMessage() = %q, want location-only guidance", got)
if got := u.remotePreferencesCurrentSummary(); got != "Current choice: KeePassGO will remember only the WebDAV location for this connection." {
t.Fatalf("remotePreferencesCurrentSummary() = %q, want location-only guidance", got)
}
u.rememberRemoteAuth.Value = true
if got := u.remoteAuthStatusMessage(); got != "Enter a username or password to save sign-in details for this connection." {
t.Fatalf("remoteAuthStatusMessage() = %q, want empty-sign-in guidance", got)
if got := u.remotePreferencesCurrentSummary(); got != "Current choice: sign-in retention is enabled, but no username or password is entered yet." {
t.Fatalf("remotePreferencesCurrentSummary() = %q, want empty-sign-in guidance", got)
}
u.remoteUsername.SetText("alice")
if got := u.remoteAuthStatusMessage(); got != "This sign-in will be saved in Recent Connections after a successful open." {
t.Fatalf("remoteAuthStatusMessage() = %q, want pending-save guidance", got)
if got := u.remotePreferencesCurrentSummary(); got != "Current choice: a successful open will save the entered sign-in for this connection on this device." {
t.Fatalf("remotePreferencesCurrentSummary() = %q, want pending-save guidance", got)
}
u.recentRemotes = []recentRemoteRecord{{
@@ -3627,8 +3627,44 @@ func TestUIRemoteAuthStatusMessageExplainsWhatWillBeRemembered(t *testing.T) {
Username: "alice",
Password: "secret-1",
}}
if got := u.remoteAuthStatusMessage(); got != "Saved sign-in will be updated for this connection." {
t.Fatalf("remoteAuthStatusMessage() = %q, want saved-sign-in guidance", got)
if got := u.remotePreferencesCurrentSummary(); got != "Current choice: a successful open will update the saved sign-in for this connection on this device." {
t.Fatalf("remotePreferencesCurrentSummary() = %q, want saved-sign-in guidance", got)
}
}
func TestUIRemotePreferencesHelpExplainsSavedFieldsAndRetention(t *testing.T) {
t.Parallel()
u := newUIWithSession("desktop", &session.Manager{})
if got := u.remotePreferencesAlwaysSavedSummary(); got != "Recent Connections always stores the WebDAV base URL, remote path, and the last group you opened for that connection." {
t.Fatalf("remotePreferencesAlwaysSavedSummary() = %q, want saved-fields guidance", got)
}
if got := u.remotePreferencesRetentionSummary(); got != "KeePassGO keeps up to six recent connections. Turning off Remember sign-in and reopening rewrites that connection without the saved username or password." {
t.Fatalf("remotePreferencesRetentionSummary() = %q, want retention guidance", got)
}
}
func TestUIRemotePreferencesHelpDialogToggle(t *testing.T) {
t.Parallel()
u := newUIWithSession("desktop", &session.Manager{})
gtx := layout.Context{}
u.openRemotePrefsHelp.Click()
for u.openRemotePrefsHelp.Clicked(gtx) {
u.remotePrefsDialogOpen = true
}
if !u.remotePrefsDialogOpen {
t.Fatal("remotePrefsDialogOpen = false after open click, want true")
}
u.closeRemotePrefsHelp.Click()
for u.closeRemotePrefsHelp.Clicked(gtx) {
u.remotePrefsDialogOpen = false
}
if u.remotePrefsDialogOpen {
t.Fatal("remotePrefsDialogOpen = true after close click, want false")
}
}