<commit_before>import React from 'react'
import { shallow } from 'enzyme'
import PledgeCommentList from './PledgeCommentList'
import QuestionForm from './QuestionForm'

describe('<PledgeCommentList />', function () {
  const props = {
    comments: [
      {
        id: 1,
        content: 'question1',
        response: 'answer1'
      },
      {
        id: 2,
        content: 'question2'
      }
    ],
    forms: {
      questionForm: {},
      answerForm: {}
    },
    userCanAskQuestions: true,
    userCanAnswer: false,
    isSubmitting: false
  }

  it('should render', function () {
    const wrapper = shallow(<PledgeCommentList {...props} />)

    wrapper.find('div').length.should.equal(1)
  })

  it('should render a text message if there are no comments yet', function () {
    const wrapper = shallow(<PledgeCommentList {...props} comments={[]} />)

    wrapper.find('p').length.should.equal(1)
  })

  it('should render the question form with an id based on length of comments array', function() {
    const wrapper = shallow(<PledgeCommentList {...props} />)

    const questionFormProps = wrapper.find('QuestionForm').props()
    questionFormProps.id.should.equal(2)
  })
})<commit_msg>Better name for PledgeCommentList test<commit_after>import React from 'react'
import { shallow } from 'enzyme'
import PledgeCommentList from './PledgeCommentList'
import QuestionForm from './QuestionForm'

describe('<PledgeCommentList />', function () {
  const props = {
    comments: [
      {
        id: 1,
        content: 'question1',
        response: 'answer1'
      },
      {
        id: 2,
        content: 'question2'
      }
    ],
    forms: {
      questionForm: {},
      answerForm: {}
    },
    userCanAskQuestions: true,
    userCanAnswer: false,
    isSubmitting: false
  }

  it('should render', function () {
    const wrapper = shallow(<PledgeCommentList {...props} />)

    wrapper.find('div').length.should.equal(1)
  })

  it('should render a text message if there are no comments yet', function () {
    const wrapper = shallow(<PledgeCommentList {...props} comments={[]} />)

    wrapper.find('p').length.should.equal(1)
  })

  it('should render the question form with a unique id so that it gets cleared on submit', function() {
    const wrapper = shallow(<PledgeCommentList {...props} />)

    const questionFormProps = wrapper.find('QuestionForm').props()
    questionFormProps.id.should.equal(2)
  })
})
{'fraction_non_alphanumeric': 0.1390593047034765, 'fraction_numerical': 0.006543967280163599, 'mean_word_length': 2.9388083735909825, 'pattern_counts': {'":': 0, '<': 11, '<?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': '6813930', 'n_tokens_mistral': 737, 'n_tokens_neox': 701, 'n_words': 184}