"use strict";

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

var _react = _interopRequireDefault(require("react"));

var _enzyme = require("enzyme");

var _Tray = _interopRequireDefault(require("@instructure/ui-overlays/lib/components/Tray"));

var _presenter = _interopRequireDefault(require("../presenter"));

describe('ModerateTray presenter', function () {
  var props = {
    closeTray: function closeTray() {},
    isOpen: true,
    onTrayClosed: function onTrayClosed() {}
  };

  function tray(extraProps) {
    return (0, _enzyme.shallow)(_react.default.createElement(_presenter.default, Object.assign({}, extraProps, props), "---")).find(_Tray.default);
  }

  it('passes isOpen to the Tray component', function () {
    expect(tray().prop('open')).equal(props.isOpen);
  });
  it('passes closeTray to the Tray component', function () {
    expect(tray().prop('onDismiss')).equal(props.closeTray);
  });
  it('passes label to the Tray component', function () {
    expect(tray().prop('label')).to.equal('Moderate');
  });
  it("includes the participant name in the Tray's label if given", function () {
    expect(tray({
      participantName: 'ohai'
    }).prop('label')).to.equal('ohai');
  });
});