Refresh HiveGrid Cloud reference snapshot

This commit is contained in:
david committed 2026-08-03 15:31:14 +02:00
1 parent 5e99e14772
commit 7f88026f79
5955 files changed
+1177325 -188362

No files matched your search

@@ -21,39 +21,42 @@ describe("entitlements package shell", () => {
expect(blueprint).toMatchObject({
id: productBlueprintIds.crmSaas,
version: "2026.05.15",
version: "2026.07.20",
defaultShowcase: true,
});
expect(blueprint.features.map((feature) => feature.featureKey)).toEqual(
expect.arrayContaining([featureKeys.crmBasic, featureKeys.supportTickets, featureKeys.workflowEngine, featureKeys.mcp])
expect.arrayContaining([featureKeys.crmBasic, featureKeys.chat, featureKeys.supportTickets, featureKeys.workflowEngine, featureKeys.mcp])
);
});
it("keeps Starter, Pro, and Business realistically strict", () => {
expect(getStandardEntitlementPlan(entitlementPlanIds.starter)?.features).toEqual(
it("keeps Core, Swarm, and Colony on one HiveGrid core", () => {
const starter = getStandardEntitlementPlan(entitlementPlanIds.starter)!;
const team = getStandardEntitlementPlan(entitlementPlanIds.pro)!;
const business = getStandardEntitlementPlan(entitlementPlanIds.business)!;
const withoutPortal = (plan: typeof starter) =>
plan.features
.filter((feature) => feature.featureKey !== featureKeys.customerPortal)
.map(({ featureKey, limitType, limit }) => ({ featureKey, limitType, limit }));
expect(starter.metadata.publicName).toBe("Core");
expect(team.metadata.publicName).toBe("Swarm");
expect(business.metadata.publicName).toBe("Colony");
expect(withoutPortal(starter)).toEqual(withoutPortal(team));
expect(withoutPortal(team)).toEqual(withoutPortal(business));
expect(starter.features).toEqual(
expect.arrayContaining([
expect.objectContaining({ featureKey: featureKeys.crmBasic, limitType: entitlementLimitTypes.included }),
expect.objectContaining({ featureKey: featureKeys.api, limitType: entitlementLimitTypes.notIncluded }),
expect.objectContaining({ featureKey: featureKeys.workflowEngine, limitType: entitlementLimitTypes.notIncluded }),
])
);
expect(getStandardEntitlementPlan(entitlementPlanIds.pro)?.features).toEqual(
expect.arrayContaining([
expect.objectContaining({ featureKey: featureKeys.emailMarketing, limitType: entitlementLimitTypes.monthly }),
expect.objectContaining({ featureKey: featureKeys.api, limitType: entitlementLimitTypes.included }),
expect.objectContaining({ featureKey: featureKeys.workflowEngine, limitType: entitlementLimitTypes.notIncluded }),
])
);
expect(getStandardEntitlementPlan(entitlementPlanIds.business)?.features).toEqual(
expect.arrayContaining([
expect.objectContaining({ featureKey: featureKeys.workflowEngine, limitType: entitlementLimitTypes.monthly }),
expect.objectContaining({ featureKey: featureKeys.mcp, limitType: entitlementLimitTypes.included }),
expect.objectContaining({ featureKey: featureKeys.advancedBuilder, limitType: entitlementLimitTypes.included }),
expect.objectContaining({ featureKey: featureKeys.workflowEngine, limitType: entitlementLimitTypes.unlimited }),
expect.objectContaining({ featureKey: featureKeys.kwpIntegration, limitType: entitlementLimitTypes.notIncluded }),
])
);
expect(starter.features.some((feature) => feature.featureKey === featureKeys.credits)).toBe(false);
expect(starter.features.some((feature) => feature.featureKey === featureKeys.privateGenerations)).toBe(false);
});
it("evaluates product access through blueprint, plan, tenant override, and tenant-owned role permission", () => {
// Fundament D: workflow-engine is a core module, so a plan listing it as
// not-included no longer blocks it — core access is granted with reason "included".
expect(
evaluateProductAccess({
blueprintId: productBlueprintIds.crmSaas,
@@ -62,7 +65,7 @@ describe("entitlements package shell", () => {
limitType: entitlementLimitTypes.notIncluded,
tenantRolePermissionNames: ["app.settings.roles.set"],
})
).toMatchObject({ allowed: false, reason: "not-included" });
).toMatchObject({ allowed: true, reason: "included" });
expect(
evaluateProductAccess({
@@ -101,10 +104,13 @@ describe("entitlements package shell", () => {
})
).toMatchObject({ allowed: true, reason: "monthly-remaining", remaining: 90 });
// A non-toggleable ADD-ON (ai-credits: not includedInCore) still rejects an "enabled"
// override — a tenant cannot self-enable a paid add-on. Core modules are exempted (see
// product-access.edge.test.ts), so this uses an add-on to keep exercising the path.
expect(
evaluateProductAccess({
blueprintId: productBlueprintIds.crmSaas,
featureKey: featureKeys.crmBasic,
featureKey: featureKeys.credits,
hasSubscription: true,
limitType: entitlementLimitTypes.notIncluded,
tenantOverride: "enabled",