import { toBoolean } from './query-transform.util';

describe('query transform util', () => {
  it('converts "true" and "false" string values correctly', () => {
    expect(toBoolean({ value: 'true' })).toBe(true);
    expect(toBoolean({ value: 'TRUE' })).toBe(true);
    expect(toBoolean({ value: 'false' })).toBe(false);
    expect(toBoolean({ value: 'FALSE' })).toBe(false);
  });

  it('leaves unrelated values unchanged', () => {
    expect(toBoolean({ value: '0' })).toBe('0');
    expect(toBoolean({ value: 'hello' })).toBe('hello');
    expect(toBoolean({ value: 1 })).toBe(1);
  });
});
