<commit_before>import { expect } from 'chai'
import chai from 'chai'
import { shallow, render, mount } from 'enzyme'
import { spy } from 'sinon'
import React from 'react'
import sinonChai from 'sinon-chai'

import DonateForm from '../../src/components/DonateForm'

chai.use(sinonChai)

// describe('DonateForm', () => {
//   const props = { getValue: spy() }
//   const expected = 'test.value'
//   it('should pass the value of the input field to the donateFunction function when the button is clicked', () => {
//     const wrapper = mount(React.createElement(DonateForm))
//     let input = wrapper.find('TextField')
//     input.get(5).value = expected
//     let button = wrapper.find('RaisedButton')
//     button.simulate('keyDown', onClick)
//     spy.assert.calledOnce(donateFunction)
//   })
// })

describe('DonateForm', () => {
  it('should render a donation form in a span', () => {
    const wrapper = shallow(React.createElement(DonateForm))
    expect(wrapper.find('#DonateForm')).to.have.length(1)
  })
  const props = {
    received : 300,
    target : 300
  }
  it('should display Fully Funded when received >= target', () => {
    const wrapper = shallow(React.createElement(DonateForm), props)
    expect(wrapper.find('div.fullyFunded')).to.have.length(1)
    expect(wrapper.find('div.fullyFunded')).to.have.text('Fully Funded')
  })

})

describe('DonateButton', () => {
  it('should render a raised button', () => {
    const wrapper = shallow(React.createElement(DonateForm))
    expect(wrapper.find('RaisedButton')).to.have.length(1)
  })
})

describe('InputField', () => {
  it('should render an input field', () => {
    const wrapper = shallow(React.createElement(DonateForm))
    expect(wrapper.find('TextField')).to.have.length(1)
  })

})


describe('InputField', () => {
  it('should render an input field with the type of number', () => {
    const wrapper = shallow(React.createElement(DonateForm))
    expect(wrapper.find('#donateInput')).to.have.attr('type', 'number')
  })
})



//give props of donateFunction
//pass down result of spy<commit_msg>review of tests<commit_after>import { expect } from 'chai'
import chai from 'chai'
import { shallow, render, mount } from 'enzyme'
import { spy } from 'sinon'
import React from 'react'
import sinonChai from 'sinon-chai'

import DonateForm from '../../src/components/DonateForm'

chai.use(sinonChai)

// describe('DonateForm', () => {
//   const props = { getValue: spy() }
//   const expected = 'test.value'

//   it('should pass the value of the input field to the donateFunction function when the button is clicked', () => {
//     const wrapper = mount(React.createElement(DonateForm))
//     let input = wrapper.find('TextField')
//     input.get(5).value = expected
//     let button = wrapper.find('RaisedButton')
//     button.simulate('keyDown', onClick)
//     spy.assert.calledOnce(donateFunction)
//   })
// })

describe('DonateForm', () => {
  it('should render a donation form in a span', () => {
    const wrapper = shallow(React.createElement(DonateForm))
    expect(wrapper.find('#DonateForm')).to.have.length(1)
  })
  const props = {
    received : 300,
    target : 300
  }
  xit('should display Fully Funded when received >= target', () => {
    const wrapper = shallow(React.createElement(DonateForm), props)
    expect(wrapper.find('div.fullyFunded')).to.have.length(1)
    expect(wrapper.find('div.fullyFunded')).to.have.text('Fully Funded')
  })

})

describe('DonateButton', () => {
  it('should render a raised button', () => {
    const wrapper = shallow(React.createElement(DonateForm))
    expect(wrapper.find('RaisedButton')).to.have.length(1)
  })
})

describe('InputField', () => {
  it('should render an input field', () => {
    const wrapper = shallow(React.createElement(DonateForm))
    expect(wrapper.find('TextField')).to.have.length(1)
  })

})


describe('InputField', () => {
  it('should render an input field with the type of number', () => {
    const wrapper = shallow(React.createElement(DonateForm))
    expect(wrapper.find('#donateInput')).to.have.attr('type', 'number')
  })
})

{'fraction_non_alphanumeric': 0.16978837265872052, 'fraction_numerical': 0.00535149598637801, 'mean_word_length': 3.8778173190984577, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '6066550', 'n_tokens_mistral': 1299, 'n_tokens_neox': 1285, 'n_words': 288}