"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const next_action_predictor_1 = require("../next-action-predictor");
describe('NextActionPredictor', () => {
    let predictor;
    beforeEach(() => {
        predictor = new next_action_predictor_1.NextActionPredictor();
    });
    test('returns default suggestions when no history', () => {
        const predictions = predictor.predictNext([]);
        expect(predictions.length).toBeGreaterThan(0);
        expect(predictions.some((p) => p.action === 'model')).toBe(true);
    });
    test('records action and predicts next', () => {
        predictor.recordAction('model');
        const predictions = predictor.predictNext([]);
        expect(predictions.length).toBeGreaterThan(0);
    });
    test('learns transitions from repeated sequences', () => {
        predictor.recordAction('model');
        predictor.recordAction('validation');
        predictor.recordAction('model');
        predictor.recordAction('routes');
        const predictions = predictor.predictNext([]);
        expect(predictions.length).toBeGreaterThan(0);
    });
    test('getBulkSuggestion returns null for single prediction', () => {
        predictor.recordAction('model');
        const predictions = predictor.predictNext([]);
        const bulk = predictor.getBulkSuggestion(predictions.slice(0, 1));
        expect(bulk).toBeNull();
    });
    test('getBulkSuggestion returns bulk for multiple predictions', () => {
        predictor.recordAction('model');
        const predictions = predictor.predictNext([]);
        if (predictions.length >= 2) {
            const bulk = predictor.getBulkSuggestion(predictions);
            expect(bulk).not.toBeNull();
            expect(bulk.isBulk).toBe(true);
        }
    });
    test('records and retrieves feedback', () => {
        predictor.recordFeedback('model', true);
        predictor.recordFeedback('model', false);
        const score = predictor.getFeedbackScore('model');
        expect(score).toBe(0.5);
    });
    test('getStats returns correct structure', () => {
        predictor.recordAction('model');
        predictor.recordAction('validation');
        const stats = predictor.getStats();
        expect(stats.transitions).toBeGreaterThanOrEqual(0);
        expect(stats.sequences).toBeGreaterThan(0);
        expect(stats.feedbackEntries).toBe(0);
    });
});
//# sourceMappingURL=next-action-predictor.test.js.map