import React from 'react';
import assert from 'assert';
import { render } from 'enzyme';

import ProjectMetadata from './metadata';

describe('ProjectMetadata', () => {
  let project;

  before(() => {
    project = {
      classifiers_count: 0,
      classifications_count: 0,
      completeness: 0.56,
      display_name: 'My test project',
      subjects_count: 0,
      retired_subjects_count: 0,
      title: 'My test project'
    };
  });

  describe('render', () => {
    let wrapper;
    before(() => {
      wrapper = render(<ProjectMetadata project={project} translation={project} />);
    });

    it('renders stats', () => {
      assert(wrapper.find('.project-metadata-stat').length, 4);
    });

    it('renders 56% completeness', () => {
      assert(wrapper.find('rect').first().prop('width'), 0.56);
    });

    it('excludes TalkStatus by default', () => {
      assert.notEqual(wrapper.find('.project-home-page__talk-stat').length, 1);
    });

    it('includes TalkStatus if showTalkStatus prop is true', () => {
      wrapper = render(<ProjectMetadata project={project} translation={project} showTalkStatus={true} />);
      assert(wrapper.find('.project-home-page__talk-stat').length, 1);
    });
  });
});

@@ -154,21 +154,26 @@
 adata', 
-() =%3E
+function()
  %7B%0A  let
@@ -188,29 +188,34 @@
 ;%0A%0A  before(
-() =%3E
+function()
  %7B%0A    proje
@@ -470,21 +470,26 @@
 ender', 
-() =%3E
+function()
  %7B%0A    l
@@ -511,21 +511,26 @@
  before(
-() =%3E
+function()
  %7B%0A     
@@ -638,29 +638,34 @@
 ers stats', 
-() =%3E
+function()
  %7B%0A      ass
@@ -763,21 +763,26 @@
 eness', 
-() =%3E
+function()
  %7B%0A     
@@ -890,21 +890,26 @@
 fault', 
-() =%3E
+function()
  %7B%0A     
@@ -1057,13 +1057,18 @@
 e', 
-() =%3E
+function()
  %7B%0A 

Revert mocha functions