<commit_before>import React from 'react'
import {shallow} from 'enzyme'

import {MouseOverButton} from 'components'
import styles from 'components/styles.scss'

describe('<MouseOverButton />', () => {

  const cxt = {}

  beforeEach(() => {
    cxt.onClickSpy = sinon.spy()
  })

  it('renders the children components in the mouse over children div', () => {
    const wrapper = cxt.wrapper = shallow(
      <MouseOverButton onClick={cxt.onClickSpy}>
        <span />
      </MouseOverButton>
    )
    const mouseOverChildrenDiv = wrapper.find(`.${styles.mouseOverChildren}`)

    expect(mouseOverChildrenDiv.find('span')).to.have.length(1)
  })

  context('when clicked', () => {

    context('and the onClick prop is set', () => {

      beforeEach(() => {
        cxt.wrapper = shallow(
          <MouseOverButton onClick={cxt.onClickSpy}>
            <span />
          </MouseOverButton>
        )

        cxt.wrapper.simulate('click')
      })

      it('calls the onClick function', () => {
        expect(cxt.onClickSpy).to.have.been.called
      })

    })

  })

})<commit_msg>fixing broken import<commit_after>import React from 'react'
import {shallow} from 'enzyme'

import {MouseOverButton} from 'components'
import styles from './mouse_over_button.scss'

describe('<MouseOverButton />', () => {

  const cxt = {}

  beforeEach(() => {
    cxt.onClickSpy = sinon.spy()
  })

  it('renders the children components in the mouse over children div', () => {
    const wrapper = cxt.wrapper = shallow(
      <MouseOverButton onClick={cxt.onClickSpy}>
        <span />
      </MouseOverButton>
    )
    const mouseOverChildrenDiv = wrapper.find(`.${styles.mouseOverChildren}`)

    expect(mouseOverChildrenDiv.find('span')).to.have.length(1)
  })

  context('when clicked', () => {

    context('and the onClick prop is set', () => {

      beforeEach(() => {
        cxt.wrapper = shallow(
          <MouseOverButton onClick={cxt.onClickSpy}>
            <span />
          </MouseOverButton>
        )

        cxt.wrapper.simulate('click')
      })

      it('calls the onClick function', () => {
        expect(cxt.onClickSpy).to.have.been.called
      })

    })

  })

})
{'fraction_non_alphanumeric': 0.1540923639689072, 'fraction_numerical': 0.0009144947416552355, 'mean_word_length': 2.7084745762711866, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 31, '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': '1690715', 'n_tokens_mistral': 692, 'n_tokens_neox': 667, 'n_words': 132}