import React from 'react';
import Panel from 'react-bootstrap/lib/Panel';
import Row from 'react-bootstrap/lib/Row';

import { shallowWithIntl } from '../../../../utils/testUtils';
import ResourceEquipment from '../ResourceEquipment';

describe('pages/resource/resource-equipment/ResourceEquipment', () => {
  const defaultProps = {
    equipment: [],
  };

  function getWrapper(props) {
    return shallowWithIntl(<ResourceEquipment {...defaultProps} {...props} />);
  }

  test('renders panel and equipment heading correctly', () => {
    const panels = getWrapper().find(Panel);
    const heading = getWrapper().find('h3');
    const equipmentRow = getWrapper().find(Row);

    expect(panels).toHaveLength(1);
    expect(heading).toHaveLength(1);
    expect(heading.text()).toBe('ResourceEquipment.headingText');
    expect(equipmentRow).toHaveLength(1);
  });
});

@@ -109,16 +109,59 @@
 ib/Row';
+%0Aimport Col from 'react-bootstrap/lib/Col';
 %0A%0Aimport
@@ -385,16 +385,145 @@
 pment: %5B
+%0A      %7B%0A        name: 'Karaoke'%0A      %7D,%0A      %7B%0A        name: 'Projector'%0A      %7D,%0A      %7B%0A        name: 'Printer'%0A      %7D%0A    
 %5D,%0A  %7D;%0A
@@ -638,17 +638,16 @@
 %3E);%0A  %7D%0A
-%0A
   test('
@@ -795,57 +795,8 @@
 3');
-%0A    const equipmentRow = getWrapper().find(Row);
 %0A%0A  
@@ -938,45 +938,477 @@
 ;%0A  
-  expect(equipmentRow).toHaveLength(1
+%7D);%0A%0A  test('renders equipment content correctly', () =%3E %7B%0A    const equipmentRow = getWrapper().find(Row);%0A    const equipmentCol = getWrapper().find(Col);%0A    expect(equipmentRow).toHaveLength(1);%0A    expect(equipmentCol).toHaveLength(3);%0A  %7D);%0A%0A  test('check component props and types correctly', () =%3E %7B%0A    expect(defaultProps).toHaveProperty('equipment');%0A    expect(defaultProps.equipment).toHaveLength(3);%0A    expect(defaultProps.equipment).toBeInstanceOf(Array
 );%0A 

Add more unit tests to resource equipment component