mirror of
https://github.com/AmanTahiliani/box-box.git
synced 2026-08-07 19:56:18 -04:00
Add race control visuals and driver names in laps view
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user