Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
TypeScript
12345678910111213141516171819202122232425262728293031323334import { describe, expect, it } from "vitest";
import { allPlans } from "./config";import { YEARLY_ADDON_MULTIPLIER, getAddonPriceConfig } from "./utils";
describe("getAddonPriceConfig", () => { it("defaults to the monthly price", () => { const monthly = getAddonPriceConfig("starter", "white-label", "USD"); expect(monthly?.value).toBe( allPlans.starter.addons["white-label"]?.price.USD, ); });
it("charges the yearly price on a yearly plan", () => { const monthly = getAddonPriceConfig("starter", "status-pages", "EUR"); const yearly = getAddonPriceConfig( "starter", "status-pages", "EUR", "yearly", ); expect(yearly).toEqual({ ...monthly, value: (monthly?.value ?? 0) * YEARLY_ADDON_MULTIPLIER, }); });
it("returns null for an addon the plan does not sell", () => { expect(getAddonPriceConfig("free", "white-label", "USD", "yearly")).toBe( null, ); });});