/* eslint-env mocha */

import { Meteor } from 'meteor/meteor';
import { Factory } from 'meteor/dburles:factory';
import React from 'react';
import { shallow } from 'enzyme';
import { expect } from 'meteor/practicalmeteor:chai';
import ProgramItem from './ProgramItem.jsx';
import { resetDatabase } from 'meteor/xolvio:cleaner';

if (Meteor.isClient) {
  describe('ProgramItem', function () {
    beforeEach(function () {
      resetDatabase();
    });

    it('contains title', function () {
      const program = Factory.build('program', { title: 'Heute-Show', like: null });
      const item = shallow(<ProgramItem program={program} />);
      expect(item.text()).to.contain('Heute-Show');
    });
  });
}

@@ -168,16 +168,48 @@
 nzyme';%0A
+import %7B mount %7D from 'enzyme';%0A
 import %7B
@@ -299,16 +299,61 @@
 m.jsx';%0A
+import DecisionBox from './ProgramItem.jsx';%0A
 import %7B
@@ -770,16 +770,322 @@
 %0A    %7D);
+%0A%0A    context('when already decided on', function () %7B%0A      it('does not show actions', function () %7B%0A        const program = Factory.build('program', %7B like: 'No'%7D);%0A        const item = mount(%3CProgramItem program=%7Bprogram%7D /%3E);%0A        expect(item.find(DecisionBox)).to.have.length(0);%0A      %7D);%0A    %7D);
 %0A  %7D);%0A%7D

add test decision actions should not be present if already decided on