fix: unblock first growth report generation
This commit is contained in:
@@ -70,7 +70,7 @@ func TestRepositoryAllowsManualRefreshUntilAISummaryExists(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if next, err := repository.NextRefreshAt(ctx, merchantID, "", start); err != nil || next.After(start) {
|
||||
if next, err := repository.NextRefreshAt(ctx, merchantID, "", "test", start); err != nil || next.After(start) {
|
||||
t.Fatalf("refresh without AI summary should remain available: next=%s error=%v", next, err)
|
||||
}
|
||||
second, _, err := repository.CreateOrReuse(ctx, newInput("growth_bbbbbbbbbbbbbbbbbbbbbbbb", "second"), nil)
|
||||
@@ -84,7 +84,7 @@ func TestRepositoryAllowsManualRefreshUntilAISummaryExists(t *testing.T) {
|
||||
if !errors.Is(err, ErrRefreshLimited) {
|
||||
t.Fatalf("refresh after AI summary error=%v, want ErrRefreshLimited (first=%s)", err, first.ReportID)
|
||||
}
|
||||
if next, err := repository.NextRefreshAt(ctx, merchantID, "", start); err != nil || !next.After(start) {
|
||||
if next, err := repository.NextRefreshAt(ctx, merchantID, "", "test", start); err != nil || !next.After(start) {
|
||||
t.Fatalf("refresh after AI summary should have a future boundary: next=%s error=%v", next, err)
|
||||
}
|
||||
}
|
||||
@@ -103,6 +103,9 @@ func TestRepositoryLatestIgnoresReportsFromOlderAnalyticsVersions(t *testing.T)
|
||||
if _, err := repository.Latest(ctx, merchantID, "", "1.2.0"); !errors.Is(err, ErrNotFound) {
|
||||
t.Fatalf("Latest error=%v, want ErrNotFound for a stale analytics version", err)
|
||||
}
|
||||
if hasSummary, err := repository.HasAISummary(ctx, merchantID, "", "1.2.0"); err != nil || hasSummary {
|
||||
t.Fatalf("stale analytics versions must not count as a visible AI summary: hasSummary=%t error=%v", hasSummary, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRepositoryRefreshQuotaIsScopedPerTerminal(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user