Shift remote open copy to local-first flow
This commit is contained in:
@@ -5301,6 +5301,47 @@ func TestUIRemoteOpenButtonLabelOffersRetryAfterFailure(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestUIRemoteLifecycleMessageUsesLocalCacheLanguageForBoundRemote(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
u := newUIWithSession("desktop", &session.Manager{})
|
||||
u.lifecycleMode = "remote"
|
||||
u.applyRecentRemoteRecord(recentRemoteRecord{
|
||||
BaseURL: "https://dav.example.invalid",
|
||||
Path: "vaults/home.kdbx",
|
||||
LocalVaultPath: "/vaults/cache/home.kdbx",
|
||||
RemoteProfileID: "remote-profile-1",
|
||||
CredentialEntryID: "remote-creds-1",
|
||||
})
|
||||
|
||||
if got := u.remoteLifecycleMessage(); got != "Open the local cache for this remote vault, then unlock and sync it with the vault-stored remote settings." {
|
||||
t.Fatalf("remoteLifecycleMessage() = %q, want local-cache guidance", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUIRemoteOpenButtonLabelUsesLocalCacheLanguageForBoundRemote(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
u := newUIWithSession("desktop", &session.Manager{})
|
||||
u.lifecycleMode = "remote"
|
||||
u.applyRecentRemoteRecord(recentRemoteRecord{
|
||||
BaseURL: "https://dav.example.invalid",
|
||||
Path: "vaults/home.kdbx",
|
||||
LocalVaultPath: "/vaults/cache/home.kdbx",
|
||||
RemoteProfileID: "remote-profile-1",
|
||||
CredentialEntryID: "remote-creds-1",
|
||||
})
|
||||
|
||||
if got := u.remoteOpenButtonLabel(); got != "Open Cached Vault" {
|
||||
t.Fatalf("remoteOpenButtonLabel() = %q, want %q", got, "Open Cached Vault")
|
||||
}
|
||||
|
||||
u.state.ErrorMessage = "open remote vault failed: dial tcp timeout"
|
||||
if got := u.remoteOpenButtonLabel(); got != "Retry Cached Vault" {
|
||||
t.Fatalf("remoteOpenButtonLabel() after error = %q, want %q", got, "Retry Cached Vault")
|
||||
}
|
||||
}
|
||||
|
||||
func TestUIOpenRemoteVaultRestoresLastOpenedGroupForThatConnection(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user