"use strict";
/**
 * E2E Test: Authentication Configuration
 *
 * Tests that authentication-related files are generated correctly
 * Note: Tests are placeholders for future implementation when extended workflow support is added
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
const fs = __importStar(require("fs"));
const path = __importStar(require("path"));
const generation_orchestrator_1 = require("../generators/generation-orchestrator");
describe('E2E: Authentication Configuration', () => {
    const testOutputDir = path.join(__dirname, '../../.e2e-output/auth-test');
    let orchestrator;
    beforeEach(() => {
        if (fs.existsSync(testOutputDir)) {
            fs.rmSync(testOutputDir, { recursive: true, force: true });
        }
        orchestrator = new generation_orchestrator_1.GenerationOrchestrator();
    });
    afterEach(() => {
        if (fs.existsSync(testOutputDir)) {
            fs.rmSync(testOutputDir, { recursive: true, force: true });
        }
    });
    it('should generate backend with authentication support', async () => {
        const workflow = {
            workflow: {
                id: 'auth-test',
                version: '1.0.0',
                name: 'Auth Test',
            },
            stack: {
                api: {
                    type: 'backend',
                    technology: 'typescript/express',
                    config: { port: 3000 },
                },
            },
            stages: {
                local: {
                    infrastructure: {
                        databases: {
                            main: {
                                type: 'postgresql',
                                config: { host: 'localhost', port: 5432 },
                            },
                        },
                        services: {},
                    },
                },
            },
        };
        const result = await orchestrator.generate(workflow, {
            outputDirectory: testOutputDir,
            dryRun: false,
            verbose: false,
        });
        // Verify files were generated
        expect(result.files.length).toBeGreaterThan(0);
        expect(result.written.length).toBeGreaterThan(0);
        // Verify files are in the correct directory
        result.files.forEach(file => {
            expect(file.path.startsWith(testOutputDir)).toBe(true);
        });
    });
    // Note: Additional tests for JWT auth, RBAC, protected routes, and frontend auth
    // will be added when extended workflow parser is implemented
});
//# sourceMappingURL=auth-config.e2e.test.js.map