diff --git a/web/src/constants/config.ts b/web/src/constants/config.ts index 2cd0be660b..f702962e94 100644 --- a/web/src/constants/config.ts +++ b/web/src/constants/config.ts @@ -26,6 +26,7 @@ export const config = { export const siteURL = { contactSales: "https://openobserve.ai/contactus/", contactSupport: "https://openobserve.ai/contactus/", + // Schema (pricingOptions, inPriceBlock, additionalInfo) is documented in website5 src/content/pages/pricing.json `_comment`. pricingJsonUrl: "https://openobserve.ai/pricing.json", }; diff --git a/web/src/enterprise/components/billings/enterprisePlan.spec.ts b/web/src/enterprise/components/billings/enterprisePlan.spec.ts index 0a8b70de51..ffdb2a0343 100644 --- a/web/src/enterprise/components/billings/enterprisePlan.spec.ts +++ b/web/src/enterprise/components/billings/enterprisePlan.spec.ts @@ -294,3 +294,39 @@ describe("pa gap fixes: plan button test ids (P8)", () => { expect(w.find("button").attributes("data-test")).toBeTruthy(); }); }); + +describe("enterprisePlan.vue price line", () => { + const mountPlan = (props = {}) => + mount(enterprisePlan, { + props: { features: mockEnterpriseFeatures, ...props }, + global: { plugins: [i18n], provide: { store }, stubs: { OIcon: true } }, + }); + + it("renders the price and its note when given", () => { + const w = mountPlan({ price: { price: "Custom", note: "volume discounts, BYOB" } }); + const line = w.get('[data-test="billing-plans-enterprise-price"]').text(); + expect(line).toContain("Custom"); + expect(line).toContain("volume discounts, BYOB"); + }); + + it("keeps the seven subgrid rows as the card's direct children, priced or not", () => { + expect(mountPlan().classes()).toContain("grid-rows-subgrid"); + const priced = mountPlan({ price: { price: "Custom", note: "volume discounts, BYOB" } }); + expect(priced.element.children).toHaveLength(7); + expect(mountPlan().element.children).toHaveLength(7); + }); + + it("renders no price line without a price", () => { + expect(mountPlan().find('[data-test="billing-plans-enterprise-price"]').exists()).toBe(false); + }); + + it("shows the discount tag once: in the price block when priced, in the header otherwise", () => { + const priced = mountPlan({ price: { price: "Custom", note: "volume discounts, BYOB" } }); + expect(priced.text().match(/On discount/g)).toHaveLength(1); + expect(priced.get('[data-test="billing-plans-enterprise-price"]').text()).toContain( + "On discount", + ); + const unpriced = mountPlan(); + expect(unpriced.text().match(/On discount/g)).toHaveLength(1); + }); +}); diff --git a/web/src/enterprise/components/billings/enterprisePlan.vue b/web/src/enterprise/components/billings/enterprisePlan.vue index e30da6d13d..950b93434c 100644 --- a/web/src/enterprise/components/billings/enterprisePlan.vue +++ b/web/src/enterprise/components/billings/enterprisePlan.vue @@ -16,38 +16,46 @@ along with this program. If not, see .