"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const vitest_1 = require("vitest");
const parsers_1 = require("./parsers");
(0, vitest_1.describe)('content-as-code parsers', () => {
    (0, vitest_1.it)('parses compatible organization documents without a contentType', () => {
        (0, vitest_1.expect)((0, parsers_1.parseCustomRoleAsCode)({
            version: 1,
            name: 'Analyst',
            description: null,
            level: 'organization',
            scopes: ['view:Project'],
        }, 'analyst.yml')).toMatchObject({ name: 'Analyst' });
        (0, vitest_1.expect)((0, parsers_1.parseGroupAsCode)({ version: 1, name: 'Finance', members: [] }, 'finance.yml')).toMatchObject({ name: 'Finance' });
        (0, vitest_1.expect)((0, parsers_1.parseUserAsCode)({
            version: 1,
            email: 'user@example.com',
            disabled: false,
            role: { type: 'custom', name: 'Analyst' },
        }, 'user.yml')).toMatchObject({ email: 'user@example.com' });
    });
    (0, vitest_1.it)('rejects unsupported versions with the source filename', () => {
        (0, vitest_1.expect)(() => (0, parsers_1.parseGroupAsCode)({ version: 2, name: 'Finance', members: [] }, 'finance.yml')).toThrow('finance.yml');
    });
});
//# sourceMappingURL=parsers.test.js.map