import { describe, it, expect } from 'vitest';
import { parseIntakePolicy } from './intake-policy.adapter';

describe('intake-policy.adapter parse boundary', () => {
  it('parses a well-formed policy', () => {
    const r = parseIntakePolicy({ scholingThreshold: 800 });
    expect(r).toEqual({ ok: true, value: { scholingThreshold: 800 } });
  });

  it('rejects a missing or non-numeric threshold', () => {
    expect(parseIntakePolicy({}).ok).toBe(false);
    expect(parseIntakePolicy({ scholingThreshold: '800' }).ok).toBe(false);
    expect(parseIntakePolicy(null).ok).toBe(false);
  });
});
