"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const readme_generator_1 = require("./readme-generator");
describe('ReadmeGenerator', () => {
    let generator;
    let context;
    beforeEach(() => {
        generator = new readme_generator_1.ReadmeGenerator();
        context = {
            workflow: {
                workflow: {
                    id: 'test-app',
                    name: 'Test Application',
                    description: 'A test application',
                    version: '1.0.0',
                },
                stack: {
                    frontend: {
                        type: 'frontend',
                        technology: 'react',
                    },
                    backend: {
                        type: 'backend',
                        technology: 'typescript-express',
                    },
                },
            },
            executionPlan: {},
            outputDirectory: '/tmp/test',
            extendedWorkflow: {
                technology: {
                    frontend: {
                        framework: 'react',
                        language: 'typescript',
                        styling: 'tailwind',
                    },
                    backend: {
                        framework: 'express',
                        language: 'typescript',
                        orm: 'prisma',
                    },
                    database: {
                        type: 'postgresql',
                        version: '15',
                    },
                },
                auth: {
                    enabled: true,
                    provider: 'clerk',
                    strategies: ['email', 'google'],
                },
            },
        };
    });
    it('should have correct metadata', () => {
        expect(generator.id).toBe('readme');
        expect(generator.name).toBe('README Generator');
        expect(generator.description).toBe('Generates README.md with setup instructions');
    });
    it('should generate README.md file', () => {
        const result = generator.generate(context);
        expect(result.files).toHaveLength(1);
        expect(result.files[0].path).toContain('README.md');
        expect(result.files[0].content).toContain('# Test Application');
        expect(result.files[0].overwrite).toBe(false);
    });
    it('should include tech stack section', () => {
        const result = generator.generate(context);
        const content = result.files[0].content;
        expect(content).toContain('## Tech Stack');
        expect(content).toContain('React');
        expect(content).toContain('Express');
        expect(content).toContain('PostgreSQL');
    });
    it('should include authentication setup when auth is enabled', () => {
        const result = generator.generate(context);
        const content = result.files[0].content;
        expect(content).toContain('## Authentication Setup');
        expect(content).toContain('Clerk');
        expect(content).toContain('clerk.com');
    });
    it('should not include auth section when auth is not enabled', () => {
        context.extendedWorkflow.auth = undefined;
        const result = generator.generate(context);
        const content = result.files[0].content;
        expect(content).not.toContain('## Authentication Setup');
    });
    it('should include getting started instructions', () => {
        const result = generator.generate(context);
        const content = result.files[0].content;
        expect(content).toContain('## Getting Started');
        expect(content).toContain('### Prerequisites');
        expect(content).toContain('### Installation');
        expect(content).toContain('npm install');
    });
    it('should include development section', () => {
        const result = generator.generate(context);
        const content = result.files[0].content;
        expect(content).toContain('## Development');
        expect(content).toContain('npm run dev');
        expect(content).toContain('npm run build');
    });
    it('should include project structure', () => {
        const result = generator.generate(context);
        const content = result.files[0].content;
        expect(content).toContain('## Project Structure');
        expect(content).toContain('backend/');
        expect(content).toContain('frontend/');
    });
    it('should include deployment section', () => {
        const result = generator.generate(context);
        const content = result.files[0].content;
        expect(content).toContain('## Deployment');
        expect(content).toContain('Docker');
    });
    it('should include Bangstack footer', () => {
        const result = generator.generate(context);
        const content = result.files[0].content;
        expect(content).toContain('Generated with Bangstack');
        expect(content).toContain('bang generate');
    });
    it('should include badges', () => {
        const result = generator.generate(context);
        const content = result.files[0].content;
        expect(content).toContain('![React]');
        expect(content).toContain('![Express]');
        expect(content).toContain('![TypeScript]');
        expect(content).toContain('![PostgreSQL]');
        expect(content).toContain('![Bangstack]');
    });
});
//# sourceMappingURL=readme-generator.test.js.map