feat(voice): per-account choice between Whisper and the browser; STT_ALLOW_BROWSER
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 2m40s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 2m40s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
55112b940c
commit
a927a94a95
21 files changed
+288
-15
No files matched your search
@@ -0,0 +1,24 @@
|
||||
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")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user