Race is the 8th fixed workout kind, seeded with a real (not placeholder) rule since Garmin Connect's eventType.typeKey reports "race" for manually-tagged race activities. Non-running activity types (padel, cycling, strength training, ...) are now dropped at sync time instead of being stored. The Review Queue's type filter is now clickable exclusive pill buttons instead of a dropdown.
37 lines
853 B
Go
37 lines
853 B
Go
package store
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
)
|
|
|
|
func TestWorkoutTaxonomy_SeededWithEightFixedTypes(t *testing.T) {
|
|
db := openTestDB(t)
|
|
ctx := context.Background()
|
|
|
|
kinds, err := db.ListWorkoutKinds(ctx, true)
|
|
if err != nil {
|
|
t.Fatalf("ListWorkoutKinds: %v", err)
|
|
}
|
|
if len(kinds) != 8 {
|
|
t.Fatalf("expected 8 seeded workout kinds, got %d: %+v", len(kinds), kinds)
|
|
}
|
|
|
|
wantNames := map[string]bool{
|
|
"Easy Run": false, "Long Run": false, "Threshold 30'": false, "Threshold 60'": false,
|
|
"Tempo": false, "Interval": false, "MAS Test": false, "Race": false,
|
|
}
|
|
for _, k := range kinds {
|
|
if _, ok := wantNames[k.Name]; !ok {
|
|
t.Errorf("unexpected seeded kind name %q", k.Name)
|
|
continue
|
|
}
|
|
wantNames[k.Name] = true
|
|
}
|
|
for name, found := range wantNames {
|
|
if !found {
|
|
t.Errorf("expected seeded kind %q, not found", name)
|
|
}
|
|
}
|
|
}
|