import { describe, expect, test } from 'bun:test';

import { parseFeatureFlag } from '../media/config';

describe('media config feature flags', () => {
  test('parses enabled values', () => {
    expect(parseFeatureFlag('true', false)).toBe(true);
    expect(parseFeatureFlag('1', false)).toBe(true);
    expect(parseFeatureFlag('yes', false)).toBe(true);
  });

  test('parses disabled values', () => {
    expect(parseFeatureFlag('false', true)).toBe(false);
    expect(parseFeatureFlag('0', true)).toBe(false);
    expect(parseFeatureFlag('off', true)).toBe(false);
  });

  test('falls back to default value for unknown input', () => {
    expect(parseFeatureFlag(undefined, true)).toBe(true);
    expect(parseFeatureFlag('maybe', false)).toBe(false);
  });
});
