"use strict";

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

var _ = _interopRequireDefault(require("../"));

var _immutable = require("immutable");

var _Tag = _interopRequireDefault(require("@instructure/ui-elements/lib/components/Tag"));

describe('TagDisplay', function () {
  var testbed = createTestbed(_.default, {});
  shouldRenderComponent(testbed, {}, _.default);
  it('should render no tags', function () {
    testbed.render();
    expect(testbed.findChildrenByType(_Tag.default).length).to.eq(0);
  });
  it('should render a single tag', function () {
    testbed.render({
      tagAssociations: (0, _immutable.fromJS)([{
        id: '1',
        tag_id: '1',
        tag_value: 'hi'
      }])
    });
    expect(testbed.findChildrenByType(_Tag.default).length).to.eq(1);
  });
  it('renders up to two tags plus an extra pill', function () {
    testbed.render({
      tagAssociations: (0, _immutable.fromJS)([{
        id: '1',
        tag_id: '1',
        tag_value: 'test1'
      }, {
        id: '2',
        tag_id: '2',
        tag_value: 'test2'
      }, {
        id: '3',
        tag_id: '3',
        tag_value: 'test3'
      }, {
        id: '4',
        tag_id: '4',
        tag_value: 'test4'
      }])
    });
    expect(testbed.findChildrenByType(_Tag.default).length).to.eq(3);
  });
});