Add race control visuals and driver names in laps view

This commit is contained in:
2026-05-25 15:55:36 -04:00
parent 3eb74a9083
commit a2aa772838
21 changed files with 458 additions and 118 deletions

View File

@@ -9,6 +9,7 @@ import (
"time"
"github.com/AmanTahiliani/box-box/internal/api"
"github.com/AmanTahiliani/box-box/internal/models"
"github.com/AmanTahiliani/box-box/internal/query"
"github.com/AmanTahiliani/box-box/internal/store"
)
@@ -151,6 +152,19 @@ func TestHandleRaceHubRequiresSessionKey(t *testing.T) {
}
}
func TestBuildDriverMapFirstKeepsFirstDuplicateDriverNumber(t *testing.T) {
drivers := []models.Driver{
{DriverNumber: 4, NameAcronym: "NOR", TeamName: "McLaren"},
{DriverNumber: 4, NameAcronym: "NOR", TeamName: "Red Bull Racing"},
}
driverMap := buildDriverMapFirst(drivers)
driver := driverMap[4]
if driver.TeamName != "McLaren" {
t.Fatalf("team = %q, want McLaren", driver.TeamName)
}
}
func TestHandleSeasonsEmpty(t *testing.T) {
srv := testServer(t, nil)
req := httptest.NewRequest(http.MethodGet, "/api/v1/seasons", nil)