Files
MindSift/internal/storage/voice_input_test.go
T
sandrodachandClaude Opus 5.5 a927a94a95
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 2m40s
feat(voice): per-account choice between Whisper and the browser; STT_ALLOW_BROWSER
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 15:19:20 +01:00

25 lines
694 B
Go

package storage
import (
"path/filepath"
"testing"
)
func TestVoiceInputChoice(t *testing.T) {
store, err := NewStore(filepath.Join(t.TempDir(), "voice.db"))
if err != nil {
t.Fatalf("NewStore: %v", err)
}
defer store.Close()
anna, _ := store.CreateUser("anna@example.com", "hash", "Anna", "member")
if v := store.VoiceInput(anna.ID); v != "" {
t.Fatalf("default should be the Whisper server (\"\"), got %q", v)
}
if err := store.SetVoiceInput(anna.ID, "browser"); err != nil || store.VoiceInput(anna.ID) != "browser" {
t.Fatalf("browser not stored: %v", err)
}
if err := store.SetVoiceInput(anna.ID, "google"); err == nil {
t.Fatal("unknown values must be refused")
}
}