"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const node_test_1 = require("node:test");
const strict_1 = __importDefault(require("node:assert/strict"));
const vendor_code_mask_1 = require("./vendor-code-mask");
(0, node_test_1.describe)('maskVendorCode (issue #1296 — extracted from billing-vendor-codes-routes + runtime-link-routes)', () => {
    (0, node_test_1.it)('masks a full 14-char suffix to first-4 + last-4 with ellipsis', () => {
        strict_1.default.equal((0, vendor_code_mask_1.maskVendorCode)('cxni_v1_abcdefghijklmn'), 'cxni_v1_abcd...klmn');
    });
    (0, node_test_1.it)('returns the full code when the suffix is <= 8 chars (nothing to mask)', () => {
        strict_1.default.equal((0, vendor_code_mask_1.maskVendorCode)('cxni_v1_short'), 'cxni_v1_short');
        strict_1.default.equal((0, vendor_code_mask_1.maskVendorCode)('cxni_v1_12345678'), 'cxni_v1_12345678');
    });
    (0, node_test_1.it)('falls back to first-8 + ellipsis for non-standard prefixes', () => {
        strict_1.default.equal((0, vendor_code_mask_1.maskVendorCode)('legacy-style-vendor-code-xyz'), 'legacy-s...');
        strict_1.default.equal((0, vendor_code_mask_1.maskVendorCode)('short'), 'short...');
    });
    (0, node_test_1.it)('is pure — same input always yields same output', () => {
        const input = 'cxni_v1_repeatable000xy';
        strict_1.default.equal((0, vendor_code_mask_1.maskVendorCode)(input), (0, vendor_code_mask_1.maskVendorCode)(input));
    });
    (0, node_test_1.it)('does not leak the middle of the suffix', () => {
        const masked = (0, vendor_code_mask_1.maskVendorCode)('cxni_v1_SECRETSECRETzz');
        strict_1.default.ok(!masked.includes('SECRET'), 'middle of suffix must be redacted');
        strict_1.default.ok(masked.startsWith('cxni_v1_SECR'), 'first 4 chars preserved');
        strict_1.default.ok(masked.endsWith('Tzz'), 'last 4 chars preserved (Tzz from "ETzz")');
    });
});
//# sourceMappingURL=vendor-code-mask.test.js.map