Initial commit: smartrun MVP
Garmin run classification and progression tracker. Go backend (MCP client to mcp-garmin, SQLite store, deterministic rule engine, REST API) and React/TS frontend (Dashboard, Review Queue, Workout Kinds). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
22
backend/internal/garmin/client_test.go
Normal file
22
backend/internal/garmin/client_test.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package garmin
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestParseAuthResult(t *testing.T) {
|
||||
cases := []struct {
|
||||
msg string
|
||||
want AuthStatus
|
||||
}{
|
||||
{"Authenticated successfully.", AuthSuccess},
|
||||
{"MFA accepted. Authenticated successfully.", AuthSuccess},
|
||||
{"MFA required. Garmin has sent a verification code...", AuthMFARequired},
|
||||
{"Authentication failed: 401 Unauthorized (Invalid Username or Password)", AuthFailed},
|
||||
{"Authentication failed after MFA: bad code", AuthFailed},
|
||||
}
|
||||
for _, c := range cases {
|
||||
got := parseAuthResult(c.msg)
|
||||
if got.Status != c.want {
|
||||
t.Errorf("parseAuthResult(%q).Status = %v, want %v", c.msg, got.Status, c.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user