<commit_before>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);
  });
});<commit_msg>Add more unit tests to resource equipment component<commit_after>import React from 'react';
import Panel from 'react-bootstrap/lib/Panel';
import Row from 'react-bootstrap/lib/Row';
import Col from 'react-bootstrap/lib/Col';

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

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

  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');

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

  test('renders equipment content correctly', () => {
    const equipmentRow = getWrapper().find(Row);
    const equipmentCol = getWrapper().find(Col);
    expect(equipmentRow).toHaveLength(1);
    expect(equipmentCol).toHaveLength(3);
  });

  test('check component props and types correctly', () => {
    expect(defaultProps).toHaveProperty('equipment');
    expect(defaultProps.equipment).toHaveLength(3);
    expect(defaultProps.equipment).toBeInstanceOf(Array);
  });
});
{'fraction_non_alphanumeric': 0.16120906801007556, 'fraction_numerical': 0.0041981528127623844, 'mean_word_length': 3.964583333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3317882', 'n_tokens_mistral': 704, 'n_tokens_neox': 678, 'n_words': 132}