"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const vitest_1 = require("vitest");
const pricingModel_js_1 = require("./pricingModel.js");
(0, vitest_1.describe)('PricingModelEnum', () => {
    (0, vitest_1.it)('uses stable string values for the billing.pricing_model column', () => {
        (0, vitest_1.expect)(pricingModel_js_1.PricingModelEnum.SEATS).toBe('seats');
        (0, vitest_1.expect)(pricingModel_js_1.PricingModelEnum.CREDITS).toBe('credits');
    });
});
(0, vitest_1.describe)('isCreditsPricing', () => {
    (0, vitest_1.it)('is true only for credits-based orgs', () => {
        (0, vitest_1.expect)((0, pricingModel_js_1.isCreditsPricing)(pricingModel_js_1.PricingModelEnum.CREDITS)).toBe(true);
    });
    (0, vitest_1.it)('is false for seat-based orgs', () => {
        (0, vitest_1.expect)((0, pricingModel_js_1.isCreditsPricing)(pricingModel_js_1.PricingModelEnum.SEATS)).toBe(false);
    });
    (0, vitest_1.it)('defaults to false (seat-based) when the model is absent, so existing orgs are grandfathered', () => {
        (0, vitest_1.expect)((0, pricingModel_js_1.isCreditsPricing)(undefined)).toBe(false);
        (0, vitest_1.expect)((0, pricingModel_js_1.isCreditsPricing)(null)).toBe(false);
    });
});
(0, vitest_1.describe)('isSeatsPricing', () => {
    (0, vitest_1.it)('is true for seat-based orgs', () => {
        (0, vitest_1.expect)((0, pricingModel_js_1.isSeatsPricing)(pricingModel_js_1.PricingModelEnum.SEATS)).toBe(true);
    });
    (0, vitest_1.it)('is false for credits-based orgs', () => {
        (0, vitest_1.expect)((0, pricingModel_js_1.isSeatsPricing)(pricingModel_js_1.PricingModelEnum.CREDITS)).toBe(false);
    });
    (0, vitest_1.it)('treats an absent model as seat-based, so existing orgs are grandfathered', () => {
        (0, vitest_1.expect)((0, pricingModel_js_1.isSeatsPricing)(undefined)).toBe(true);
        (0, vitest_1.expect)((0, pricingModel_js_1.isSeatsPricing)(null)).toBe(true);
    });
});
(0, vitest_1.describe)('resolvePricingModel', () => {
    (0, vitest_1.it)('passes through recognized model values from the LD flag', () => {
        (0, vitest_1.expect)((0, pricingModel_js_1.resolvePricingModel)('credits')).toBe(pricingModel_js_1.PricingModelEnum.CREDITS);
        (0, vitest_1.expect)((0, pricingModel_js_1.resolvePricingModel)('seats')).toBe(pricingModel_js_1.PricingModelEnum.SEATS);
    });
    (0, vitest_1.it)('fails closed to seats for an unrecognized flag value (LD typo / unknown variation)', () => {
        (0, vitest_1.expect)((0, pricingModel_js_1.resolvePricingModel)('gau')).toBe(pricingModel_js_1.PricingModelEnum.SEATS);
        (0, vitest_1.expect)((0, pricingModel_js_1.resolvePricingModel)('Credits')).toBe(pricingModel_js_1.PricingModelEnum.SEATS);
        (0, vitest_1.expect)((0, pricingModel_js_1.resolvePricingModel)('')).toBe(pricingModel_js_1.PricingModelEnum.SEATS);
    });
    (0, vitest_1.it)('fails closed to seats when the flag is missing or the wrong type', () => {
        (0, vitest_1.expect)((0, pricingModel_js_1.resolvePricingModel)(undefined)).toBe(pricingModel_js_1.PricingModelEnum.SEATS);
        (0, vitest_1.expect)((0, pricingModel_js_1.resolvePricingModel)(null)).toBe(pricingModel_js_1.PricingModelEnum.SEATS);
        (0, vitest_1.expect)((0, pricingModel_js_1.resolvePricingModel)(true)).toBe(pricingModel_js_1.PricingModelEnum.SEATS);
        (0, vitest_1.expect)((0, pricingModel_js_1.resolvePricingModel)(42)).toBe(pricingModel_js_1.PricingModelEnum.SEATS);
    });
});
//# sourceMappingURL=pricingModel.test.js.map