"use strict";

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

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

var _enzyme = require("enzyme");

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

describe('Log', function () {
  it('displays an Owlet <Log> element', function () {
    var changelog = {
      _id: '5f3472928fb2420ad512fc44',
      link: 'https://docs.readme.com/guides/changelog/2020-08-17-v3-10-0',
      metadata: {
        image: [],
        title: '',
        description: ''
      },
      title: 'Owlet Weekly Update (Week of August 10)',
      slug: '2020-08-10-v3-9-2',
      body: "> 📘 What is the **Owlet Weekly Update?**\n>\n> Thanks for tuning in to another edition of our **Owlet Weekly Update** — an *owlet-sized* update (posted every Tuesday to the [ReadMe Changelog](https://docs.readme.com/guides/changelog)) where we provide an overview of the product updates that went out as part of our new Tuesday release cycle. As we refine our format and process for providing these updates, we'd love to hear what you think at [support@readme.io](mailto:support@readme.io)!",
      type: 'improved',
      hidden: true,
      user: '5af39863989da435b05d284d',
      createdAt: new Date('2020-07-01:52:02.292+0000'),
      project: '542334961972e21d7dae4e00'
    };
    var node = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_["default"], {
      logData: changelog,
      logType: "Owlet"
    }));
    expect(node.hasClass('Log')).toBe(true);
    expect(node.hasClass('Log_Owlet')).toBe(true);
    expect(node.find('.Log-Status i').hasClass('icon-readme-brandmark')).toBe(true);
  });
  it('displays an AuditLog <Log> element', function () {
    var auditlog = {
      _id: '5f1f1088f335620189768998',
      description: 'Edited \n page "Versions"',
      project: 'guides',
      link: 'https://dash.readme.io/project/guides/v2.0/docs/versions',
      filter: {
        project: 'Product Guide',
        user: 'Andy Trattner\nandy@readme.io',
        page: 'Versions',
        version: '2.0',
        action: 'EDIT'
      },
      createdAt: new Date('2020-07-27T17:36:29.752+0000')
    };
    var node = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_["default"], {
      logData: auditlog,
      logType: "AuditLog"
    }));
    expect(node.hasClass('Log')).toBe(true);
    expect(node.hasClass('Log_AuditLog')).toBe(true);
    expect(node.find('.Log-Status-Icon').hasClass('Log-Status-Icon_edit')).toBe(true);
  });
  it('displays a Deployment AuditLog <Log> element', function () {
    var deploymentAuditlog = {
      _id: '5e224256ee7e170056c98b36',
      project: 'parentproject',
      createdAt: '2020-01-17T23:25:10.730Z',
      filter: {
        action: 'DEPLOY',
        project: 'parentproject',
        user: 'adminuser@parent.com'
      },
      description: 'Changes Deployed',
      __v: 0
    };
    var node = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_["default"], {
      logData: deploymentAuditlog,
      logType: "AuditLog"
    }));
    expect(node.hasClass('Log')).toBe(true);
    expect(node.hasClass('Log_AuditLog')).toBe(true);
    expect(node.find('.Log-Status-Icon').hasClass('Log-Status-Icon_deployed')).toBe(true);
  });
});