"use strict";

var _groupByKey = _interopRequireDefault(require("./groupByKey"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var SAMPLE_DATA = [{
  name: "Poodle",
  x: "2017",
  y: 7
}, {
  name: "Terrier",
  x: "2017",
  y: 2
}, {
  name: "Bulldog",
  x: "2017",
  y: 3
}, {
  name: "Poodle",
  x: "2018",
  y: 2
}, {
  name: "Terrier",
  x: "2018",
  y: 5
}, {
  name: "Bulldog",
  x: "2018",
  y: 4
}, {
  name: "Poodle",
  x: "2019",
  y: 1
}, {
  name: "Terrier",
  x: "2019",
  y: 2
}, {
  name: "Bulldog",
  x: "2019",
  y: 3
}];
var FORMATTED_DATA = [[{
  name: "Poodle",
  x: "2017",
  y: 7
}, {
  name: "Poodle",
  x: "2018",
  y: 2
}, {
  name: "Poodle",
  x: "2019",
  y: 1
}], [{
  name: "Terrier",
  x: "2017",
  y: 2
}, {
  name: "Terrier",
  x: "2018",
  y: 5
}, {
  name: "Terrier",
  x: "2019",
  y: 2
}], [{
  name: "Bulldog",
  x: "2017",
  y: 3
}, {
  name: "Bulldog",
  x: "2018",
  y: 4
}, {
  name: "Bulldog",
  x: "2019",
  y: 3
}]];
var UNSTRUCTURED_DATA = [{
  name: "Poodle",
  x: "2017",
  y: 7
}, {
  name: "Terrier",
  x: "2019",
  y: 2
}, {
  name: "Poodle",
  x: "2018",
  y: 2
}, {
  name: "Terrier",
  x: "2018",
  y: 5
}, {
  name: "Poodle",
  x: "2019",
  y: 1
}, {
  name: "Bulldog",
  x: "2018",
  y: 4
}, {
  name: "Terrier",
  x: "2017",
  y: 2
}, {
  name: "Bulldog",
  x: "2017",
  y: 3
}, {
  name: "Bulldog",
  x: "2019",
  y: 3
}, {
  name: "Poodle",
  x: "2035",
  y: 10
}];
var FORMATTED_UNSTRUCTURED_DATA = [[{
  name: "Poodle",
  x: "2017",
  y: 7
}, {
  name: "Poodle",
  x: "2018",
  y: 2
}, {
  name: "Poodle",
  x: "2019",
  y: 1
}, {
  name: "Poodle",
  x: "2035",
  y: 10
}], [{
  name: "Terrier",
  x: "2017",
  y: 2
}, {
  name: "Terrier",
  x: "2018",
  y: 5
}, {
  name: "Terrier",
  x: "2019",
  y: 2
}], [{
  name: "Bulldog",
  x: "2017",
  y: 3
}, {
  name: "Bulldog",
  x: "2018",
  y: 4
}, {
  name: "Bulldog",
  x: "2019",
  y: 3
}]];
describe("groupByKey", function () {
  it("should format data properly", function () {
    expect((0, _groupByKey["default"])(SAMPLE_DATA, "name", "x")).to.eql(FORMATTED_DATA);
  });
  it("should format unstructured data properly", function () {
    expect((0, _groupByKey["default"])(UNSTRUCTURED_DATA, "name", "x")).to.eql(FORMATTED_UNSTRUCTURED_DATA);
  });
});