Use Android picker for local vaults
This commit is contained in:
@@ -159,6 +159,42 @@ func TestUIMasterPasswordUsesPasswordInputHint(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestLocalVaultPathHelpForAndroidUsesChooserLanguage(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
if got := localVaultPathHelpForRuntime("android"); got != "Choose the existing .kdbx file to open." {
|
||||
t.Fatalf("localVaultPathHelpForRuntime(android) = %q, want chooser guidance", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPickedDocumentNameUsesFileBaseName(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dir := t.TempDir()
|
||||
path := filepath.Join(dir, "mint-ledger.kdbx")
|
||||
if err := os.WriteFile(path, []byte("mint"), 0o600); err != nil {
|
||||
t.Fatalf("WriteFile(%q) error = %v", path, err)
|
||||
}
|
||||
file, err := os.Open(path)
|
||||
if err != nil {
|
||||
t.Fatalf("Open(%q) error = %v", path, err)
|
||||
}
|
||||
t.Cleanup(func() { _ = file.Close() })
|
||||
|
||||
if got := pickedDocumentName(file, "selected-vault.kdbx"); got != "mint-ledger.kdbx" {
|
||||
t.Fatalf("pickedDocumentName(file, fallback) = %q, want mint-ledger.kdbx", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPickedDocumentNameFallsBackWhenUnnamed(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
reader := io.NopCloser(strings.NewReader("mint"))
|
||||
if got := pickedDocumentName(reader, "crew-ledger.kdbx"); got != "crew-ledger.kdbx" {
|
||||
t.Fatalf("pickedDocumentName(reader, fallback) = %q, want crew-ledger.kdbx", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUISearchBehaviorIsConsistentAcrossDesktopAndPhoneLayouts(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user