"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _index = _interopRequireDefault(require("../index"));

var styles = {
  componentId: 'fGOwX',
  template: function template(theme) {
    return "\n\n.fGOwX_fEOG{border:".concat(theme.containerBorderWidth || 'inherit', " solid ").concat(theme.containerBorderColor || 'inherit', "}\n\n.fGOwX_dWcO{margin:0 calc(-1*").concat(theme.seriesContainerRowMargin || 'inherit', ")}\n\n.fGOwX_czwp{align-items:center;flex-direction:row;margin:").concat(theme.seriesContainerMargin || 'inherit', "}\n\n.fGOwX_fEOG .fGOwX_czwp{display:flex}\n\n.fGOwX_dWcO .fGOwX_czwp{display:inline-flex;padding:0 ").concat(theme.seriesContainerRowMargin || 'inherit', "}\n\n.fGOwX_crhW{display:flex;height:1.2rem;margin-right:").concat(theme.seriesSwatchMargin || 'inherit', ";width:1.2rem}\n\n.fGOwX_fAPS{flex:1}\n\n.fGOwX_eVVT{font-family:").concat(theme.seriesLabelFontFamily || 'inherit', ";font-size:").concat(theme.seriesLabelFontSize || 'inherit', ";white-space:nowrap}");
  },
  'containerColumn': 'fGOwX_fEOG',
  'containerRow': 'fGOwX_dWcO',
  'seriesContainer': 'fGOwX_czwp',
  'seriesSwatchContainer': 'fGOwX_crhW',
  'seriesSwatch': 'fGOwX_fAPS',
  'seriesLabel': 'fGOwX_eVVT'
};
describe('Legend', function () {
  var testbed = createTestbed(_index.default, {
    series: [{
      className: 'redClass',
      label: 'Red'
    }, {
      className: 'blueClass',
      label: 'Blue'
    }]
  });
  it('renders each series', function () {
    testbed.render();
    var series = testbed.findChildrenByClass(styles.seriesContainer);
    expect(series).to.have.length(2);
    expect(testbed.getText(series[0])).to.include('Red');
    expect(testbed.findChildrenByClass('redClass')).to.have.length(1);
    expect(testbed.getText(series[1])).to.include('Blue');
    expect(testbed.findChildrenByClass('blueClass')).to.have.length(1);
  });
  it('applies containerRow class to row variant', function () {
    testbed.render({
      variant: 'row'
    });
    var series = testbed.findChildrenBySelector(".".concat(styles.containerRow, " .").concat(styles.seriesContainer));
    expect(series).to.have.length(2);
  });
});