Propagate unlimited website entitlement through subscription checks

This commit is contained in:
Mike Cao committed 2026-06-09 13:32:52 -07:00
1 parent d2eafd68f7
commit 0c0a3aee65
4 files changed
+19

No files matched your search

+14
View File
@@ -28,4 +28,18 @@ describe('getCloudWebsiteLimit', () => {
expect(getCloudWebsiteLimit({ hasSubscription: true, isBusiness: true })).toBeNull();
expect(getCloudWebsiteLimit({ hasSubscription: true, isNoBilling: true })).toBeNull();
});
// Team-owned websites pass the team cache object (derived from the team owner's account)
// through this same function, so members inherit the owner's unlimitedWebsites entitlement.
test('does not limit teams that inherit unlimited websites from a subscribed owner', () => {
expect(
getCloudWebsiteLimit({ hasSubscription: true, isPro: true, unlimitedWebsites: true }),
).toBeNull();
});
test('still limits teams whose owner has no subscription even if unlimited websites is set', () => {
expect(
getCloudWebsiteLimit({ hasSubscription: false, unlimitedWebsites: true }),
).toBe(CLOUD_FREE_WEBSITE_LIMIT);
});
});