import { readFileSync } from 'fs';
import { parse } from 'yaml';
import { describe, expect, it } from 'vitest';
import { deepMerge } from './loader.js';

describe('config profile templates', () => {
  it('keeps config/paas.yaml in sync with default + paas overlay', () => {
    const base = parse(readFileSync('config/default.yaml', 'utf-8')) as Record<string, unknown>;
    const overlay = parse(readFileSync('config/profiles/paas.overlay.yaml', 'utf-8')) as Record<string, unknown>;
    const generated = parse(readFileSync('config/paas.yaml', 'utf-8')) as Record<string, unknown>;
    const expected = deepMerge(base, overlay);

    expect(generated).toEqual(expected);
  });
});
