"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const filter_1 = require("../types/filter");
const lightdashProjectConfig_1 = require("./lightdashProjectConfig");
describe('getSpotlightConfigurationForResource defaults', () => {
    it('threads defaultSegment and a parsed defaultFilter into spotlight', () => {
        const defaultFilter = {
            id: 'test-id',
            target: { fieldRef: 'status' },
            operator: filter_1.FilterOperator.EQUALS,
            values: ['active'],
        };
        const result = (0, lightdashProjectConfig_1.getSpotlightConfigurationForResource)({
            visibility: 'show',
            segmentBy: ['region'],
            defaultSegment: 'region',
            defaultFilter,
        });
        expect(result).toEqual({
            spotlight: {
                visibility: 'show',
                categories: undefined,
                segmentBy: ['region'],
                defaultSegment: 'region',
                defaultFilter,
            },
        });
    });
    it('omits defaults when not provided (no regression for existing configs)', () => {
        const result = (0, lightdashProjectConfig_1.getSpotlightConfigurationForResource)({
            visibility: 'show',
        });
        expect(result).toEqual({
            spotlight: { visibility: 'show', categories: undefined },
        });
    });
    it('returns an empty object when visibility is undefined', () => {
        expect((0, lightdashProjectConfig_1.getSpotlightConfigurationForResource)({ defaultSegment: 'region' })).toEqual({});
    });
});
//# sourceMappingURL=lightdashProjectConfig.test.js.map