"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const teach_context_1 = require("../walls/06-memory/teach/teach-context");
const teach_store_1 = require("../walls/06-memory/teach/teach-store");
const database_1 = require("../walls/06-memory/database/database");
describe('Teach Context', () => {
    beforeAll(() => {
        (0, database_1.getDb)();
    });
    afterEach(() => {
        (0, teach_store_1.deleteProfile)();
    });
    it('generates context string from profile', () => {
        (0, teach_store_1.saveProfileSection)('coding_style', '1. Minimal changes', { minimal_changes: 'Minimal changes' }, 85);
        (0, teach_store_1.saveProfileSection)('hates', '1. No refactors', { no_refactors: 'No refactors' }, 85);
        const source = (0, teach_context_1.getProfileForContext)();
        expect(source).not.toBeNull();
        expect(source.type).toBe('developer_profile');
        expect(source.importance).toBe(85);
        expect(source.data).toContain('Developer Profile:');
        expect(source.data).toContain('Coding Style: Minimal changes');
        expect(source.data).toContain('Hates: No refactors');
    });
    it('returns null when no profile', () => {
        const source = (0, teach_context_1.getProfileForContext)();
        expect(source).toBeNull();
    });
    it('returns null for empty profile', () => {
        const source = (0, teach_context_1.getProfileForContext)();
        expect(source).toBeNull();
    });
    it('has correct importance level', () => {
        (0, teach_store_1.saveProfileSection)('coding_style', 'Test', { test: 'Test' }, 85);
        const source = (0, teach_context_1.getProfileForContext)();
        expect(source.importance).toBe(85);
    });
    it('has correct type and reason', () => {
        (0, teach_store_1.saveProfileSection)('coding_style', 'Test', { test: 'Test' }, 85);
        const source = (0, teach_context_1.getProfileForContext)();
        expect(source.type).toBe('developer_profile');
        expect(source.reason).toBe('developer identity and preferences');
    });
});
//# sourceMappingURL=teach-context.test.js.map