import { describe, it, expect } from 'vitest';
import { DEFAULT_SEO_MODULE_SETTINGS, resolveSeoModuleSettings } from '../../seo/config-store.js';
describe('resolveSeoModuleSettings', () => {
    it('returns defaults when no overrides exist', () => {
        expect(resolveSeoModuleSettings(null)).toEqual(DEFAULT_SEO_MODULE_SETTINGS);
        expect(resolveSeoModuleSettings({})).toEqual(DEFAULT_SEO_MODULE_SETTINGS);
    });
    it('merges stored module settings over defaults', () => {
        const result = resolveSeoModuleSettings({
            module: { indexEntireSite: false, includePostsInSitemap: false },
        });
        expect(result.indexEntireSite).toBe(false);
        expect(result.includePostsInSitemap).toBe(false);
        // untouched fields keep defaults
        expect(result.sitemapEnabled).toBe(true);
        expect(result.searchConsoleConnected).toBe(false);
    });
    it('ignores undefined/null stored values', () => {
        const result = resolveSeoModuleSettings({
            module: { robotsTxt: undefined },
        });
        expect(result.robotsTxt).toBe('');
    });
    it('preserves an explicit custom robots body', () => {
        const result = resolveSeoModuleSettings({
            module: { robotsTxt: 'User-agent: *\nDisallow: /private/' },
        });
        expect(result.robotsTxt).toContain('Disallow: /private/');
    });
});
//# sourceMappingURL=config-store.test.js.map