0.3.22 - PINs

This commit is contained in:
ponzischeme89
2026-08-25 11:39:55 +12:00
parent 396d35e2f5
commit 0fcc02f57e
2697 changed files with 5360 additions and 50 deletions
+27
View File
@@ -420,6 +420,33 @@ func TestHomeForYouWindowAt(t *testing.T) {
}
}
func TestClientLocalNowPrefersTheClientHeaderOverTheHousehold(t *testing.T) {
household := time.Date(2026, time.July, 29, 23, 30, 0, 0, time.UTC)
r := httptest.NewRequest(http.MethodGet, "/v1/home", nil)
r.Header.Set(clientLocalHourHeader, "7")
got := clientLocalNow(r, household)
if got.Hour() != 7 {
t.Fatalf("hour = %d, want 7", got.Hour())
}
if got.Year() != 2026 || got.Month() != time.July || got.Day() != 29 {
t.Fatalf("date changed unexpectedly: %v", got)
}
}
func TestClientLocalNowFallsBackWithoutAUsableHeader(t *testing.T) {
household := time.Date(2026, time.July, 29, 23, 30, 0, 0, time.UTC)
for _, header := range []string{"", "not-a-number", "24", "-1"} {
r := httptest.NewRequest(http.MethodGet, "/v1/home", nil)
if header != "" {
r.Header.Set(clientLocalHourHeader, header)
}
if got := clientLocalNow(r, household); !got.Equal(household) {
t.Fatalf("header %q: got %v, want fallback %v", header, got, household)
}
}
}
func TestRecommendationBuildsAreDeduplicatedPerUser(t *testing.T) {
var builds recommendationBuilds