"use strict";

var _ReturnButton = require("../ReturnButton");

describe('ReturnButton', function () {
  var testbed = createTestbed(_ReturnButton.ReturnButton, {
    returnToUrl: null
  });
  shouldRenderComponent(testbed, {}, _ReturnButton.ReturnButton);
  context('without a return url', function () {
    it('should not render the button', function () {
      testbed.render();
      var returnButton = testbed.findChildrenByTagName('a')[0];
      expect(returnButton).not.to.exist();
    });
  });
  context('with a return url', function () {
    it('should render the button', function () {
      testbed.render({
        returnToUrl: 'https://canvas.com'
      });
      var returnButton = testbed.findChildrenByTagName('a')[0];
      expect(returnButton).to.exist();
    });
  });
});