Files
outline/shared/utils/PlanHelper.test.ts
T
Tom Moor 42f29a1a55 feat: Add plan-based feature entitlements (#13896)
* feat: Add plan-based feature entitlements

* feat: Gate audit log behind AuditLog entitlement

* Guard guests

* features
2026-09-27 09:40:50 -04:00

28 lines
806 B
TypeScript

import { Plan, PlanFeature } from "../types";
import { PlanHelper } from "./PlanHelper";
describe("PlanHelper", () => {
it("should define features for every plan", () => {
for (const plan of Object.values(Plan)) {
expect(PlanHelper.features[plan]).toBeDefined();
}
});
it("should not offer the legacy plan", () => {
expect(PlanHelper.plans).not.toContain(Plan.Legacy);
});
it("should check if a plan has a feature", () => {
expect(PlanHelper.hasFeature(Plan.Community, PlanFeature.AuditLog)).toBe(
false
);
expect(PlanHelper.hasFeature(Plan.Business, PlanFeature.AuditLog)).toBe(
true
);
});
it("should return the lowest plan with a feature", () => {
expect(PlanHelper.getMinimumPlan(PlanFeature.AuditLog)).toBe(Plan.Business);
});
});