feat: integrate creator hub douyin workflows
This commit is contained in:
@@ -44,3 +44,26 @@ func TestCollectionWindowIsFixedInUTC(t *testing.T) {
|
||||
t.Fatal("window must include both exact boundaries only")
|
||||
}
|
||||
}
|
||||
|
||||
func TestPublishedAtCollectionWindowRejectsFutureItems(t *testing.T) {
|
||||
start := time.Date(2026, 3, 1, 0, 0, 0, 0, time.UTC)
|
||||
end := start.Add(24 * time.Hour)
|
||||
before, atStart, atEnd, after := start.Add(-time.Nanosecond), start, end, end.Add(time.Nanosecond)
|
||||
for _, test := range []struct {
|
||||
name string
|
||||
at *time.Time
|
||||
want bool
|
||||
}{
|
||||
{name: "unknown", at: nil, want: true},
|
||||
{name: "before", at: &before, want: false},
|
||||
{name: "start", at: &atStart, want: true},
|
||||
{name: "end", at: &atEnd, want: true},
|
||||
{name: "future", at: &after, want: false},
|
||||
} {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
if got := publishedAtInCollectionWindow(test.at, start, end); got != test.want {
|
||||
t.Fatalf("publishedAtInCollectionWindow(%v) = %v, want %v", test.at, got, test.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user