"use strict";

var _ = require("..");

describe("getColumns", function () {
  test("getColumns({ standardColumnsObject }) => output", function () {
    var columnObject = {
      expander: {
        id: "expander",
        cellClass: ""
      },
      health: {
        Header: "Health",
        accessor: "checkStatuses"
      },
      uptime: {
        Header: "Uptime",
        accessor: "uptime"
      }
    };
    var expectedOutput = [{
      id: "expander",
      Header: expect.any(Function),
      Cell: expect.any(Function),
      sortType: "alphanumeric",
      cellClass: ""
    }, {
      Header: "Health",
      accessor: "checkStatuses",
      Cell: expect.any(Function),
      sortType: expect.any(Function),
      cellClass: "px-5 py-2"
    }, {
      Header: "Uptime",
      accessor: "uptime",
      Cell: expect.any(Function),
      sortType: expect.any(Function),
      cellClass: "px-5 py-2"
    }];
    expect((0, _.getColumns)({
      columnObject: columnObject
    })).toStrictEqual(expectedOutput);
  });
  test("getColumns({ columnsObjectWithOverridesAndMissingValues }) => output", function () {
    var columnObject = {
      health: {
        Cell: "foo",
        sortType: "foo",
        cellClass: "px-5"
      },
      uptime: {
        Header: "Uptime",
        accessor: "uptime"
      }
    };
    var expectedOutput = [{
      Header: expect.any(Function),
      Cell: "foo",
      sortType: "alphanumeric",
      cellClass: "px-5"
    }, {
      Header: "Uptime",
      accessor: "uptime",
      Cell: expect.any(Function),
      sortType: expect.any(Function),
      cellClass: "px-5 py-2"
    }];
    expect((0, _.getColumns)({
      columnObject: columnObject
    })).toStrictEqual(expectedOutput);
  });
});