import {calcColumnsWidth} from '.';

describe('calcColumnsWidth', function () {
  it('声明', function () {
    expect(calcColumnsWidth).toBeDefined();
    expect(calcColumnsWidth).toBeInstanceOf(Function);
  });

  it('结果测试', function () {
    let result = calcColumnsWidth([{title: '1'}, {title: '2'}, {title: '3'}]);
    expect(result).toBe(0);

    result = calcColumnsWidth([
      {title: '1', width: 100},
      {title: '2', width: 30},
      {title: '3'},
    ]);
    expect(result).toBe(130);

    result = calcColumnsWidth([
      {title: '1', width: 100},
      {title: '2', width: 30},
      {title: '3', width: 50},
    ]);
    expect(result).toBe(180);
  });
});
