import { describe, expect, it } from 'vitest';
import { readBackendCliSourcePreference } from './resolution';
describe('readBackendCliSourcePreference', () => {
    it('prefers target-keyed preferences from the env map', () => {
        expect(readBackendCliSourcePreference('codex', {
            HAPPIER_BACKEND_CLI_SOURCE_PREFERENCES_JSON: JSON.stringify({
                'agent:codex': 'managed-first',
                codex: 'system-first',
            }),
        })).toBe('managed-first');
    });
    it('falls back to legacy id-keyed preferences when target-keyed entries are absent', () => {
        expect(readBackendCliSourcePreference('codex', {
            HAPPIER_BACKEND_CLI_SOURCE_PREFERENCES_JSON: JSON.stringify({
                codex: 'managed-first',
            }),
        })).toBe('managed-first');
    });
});
//# sourceMappingURL=resolution.test.js.map