import { describe, expect, it } from 'vitest';
import { transformRange } from './RangeTransformer';

describe('transformRange', () => {
  it('should return a record containing from and to ranges', () => {
    const fromDate = new Date(2021, 1, 1).toISOString();
    const toDate = new Date(2021, 1, 31).toISOString();
    const fromNumber = String(4);
    const toNumber = String(5);

    expect(transformRange([fromDate, toDate])).toEqual({
      greaterThan: fromDate,
      lessThan: toDate,
    });

    expect(transformRange([fromNumber, toNumber])).toEqual({
      greaterThan: fromNumber,
      lessThan: toNumber,
    });
  });
});
