import { IOrderBy, OrderBy } from './order-by';

describe('OrderBy', () => {
  const testData: IOrderBy = {
    by: 'by',
    desc: true,
    label: 'label',
  };

  let orderBy: OrderBy;

  beforeEach(() => {
    orderBy = OrderBy.create(testData);
  });

  describe('static create(inputOptions: IUiOrderByDTO)', () => {
    it('should return an instance of UiInputDTO', () => {
      expect(orderBy instanceof OrderBy).toBe(true);
      expect(orderBy.by).toEqual(testData.by);
      expect(orderBy.desc).toEqual(testData.desc);
      expect(orderBy.label).toEqual(testData.label);
    });
  });
});
