Fix grace period tests: set StripeSubscriptionId on test companies
Trial companies (no StripeSubscriptionId) get 0 grace days by design. The GracePeriod and Expired status tests need a paid subscription to exercise the 14-day grace window correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -144,6 +144,7 @@ public class SubscriptionServiceTests
|
||||
PrimaryContactEmail = "grace@example.com",
|
||||
SubscriptionStatus = SubscriptionStatus.Active,
|
||||
SubscriptionEndDate = DateTime.UtcNow.Date.AddDays(-5),
|
||||
StripeSubscriptionId = "sub_grace_test", // paid sub — qualifies for grace period
|
||||
IsActive = true
|
||||
});
|
||||
await context.SaveChangesAsync();
|
||||
@@ -168,6 +169,7 @@ public class SubscriptionServiceTests
|
||||
PrimaryContactEmail = "expired@example.com",
|
||||
SubscriptionStatus = SubscriptionStatus.Active,
|
||||
SubscriptionEndDate = DateTime.UtcNow.Date.AddDays(-15),
|
||||
StripeSubscriptionId = "sub_expired_test", // paid sub — 15 days > 14-day grace window
|
||||
IsActive = true
|
||||
});
|
||||
await context.SaveChangesAsync();
|
||||
|
||||
Reference in New Issue
Block a user