"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const vitest_1 = require("vitest");
const utils_1 = require("./utils");
const semanticConfig = {
    title: 'Revenue by month',
    description: 'Monthly revenue trend',
    chartConfig: null,
    queryConfig: {
        exploreName: 'orders',
        dimensions: ['orders_created_month'],
        metrics: ['orders_revenue'],
        sorts: [],
        limit: 500,
        customMetrics: null,
        tableCalculations: null,
        filters: null,
    },
};
(0, vitest_1.describe)('parseAiArtifactChartConfig', () => {
    (0, vitest_1.it)('normalizes legacy semantic configs', () => {
        (0, vitest_1.expect)((0, utils_1.parseAiArtifactChartConfig)(semanticConfig)).toEqual({
            source: 'semantic',
            config: semanticConfig,
        });
    });
    (0, vitest_1.it)('accepts normalized semantic configs', () => {
        const config = { source: 'semantic', config: semanticConfig };
        (0, vitest_1.expect)((0, utils_1.parseAiArtifactChartConfig)(config)).toEqual(config);
    });
    (0, vitest_1.it)('drops legacy SQL execution UUIDs', () => {
        (0, vitest_1.expect)((0, utils_1.parseAiArtifactChartConfig)({
            source: 'sql',
            sql: 'select 1',
            limit: 500,
            queryUuid: 'expired-query',
        })).toEqual({
            source: 'sql',
            sql: 'select 1',
            limit: 500,
        });
    });
    (0, vitest_1.it)('rejects invalid configs', () => {
        (0, vitest_1.expect)((0, utils_1.parseAiArtifactChartConfig)({ source: 'sql' })).toBeNull();
    });
});
//# sourceMappingURL=utils.test.js.map