<commit_before>import React from 'react';
import ReactDOM from 'react-dom';
import {Motion} from 'react-motion';
import TestUtils, {createRenderer} from 'react-addons-test-utils';
import Button from '../src/button';
import expect from 'expect';
import expectJSX from 'expect-jsx';

expect.extend(expectJSX);

describe('Button Component test', () => {
  const renderer = createRenderer();
  it ('Should button rendered Motion component witth initial value', (done) => {
    const button = TestUtils.renderIntoDocument(<Button />);
    renderer.render(
      <Button />
    )
    const onClick = () => console.log("onclick");
    const actualElement = renderer.getRenderOutput();
    let expectedElement = (
      <Motion style={{scaleX: {config: [1500, 10], val: 1}, scaleY: {config: [1500, 10], val: 1}}} />
    );
    expect(actualElement).toEqualJSX(expectedElement);
    done();
  });

  afterEach( done => {
    ReactDOM.unmountComponentAtNode(document.body);
    document.body.innerHTML = "";
    setTimeout(done);
  });
});<commit_msg>Add state test<commit_after>import React from 'react';
import ReactDOM from 'react-dom';
import {Motion} from 'react-motion';
import TestUtils, {createRenderer} from 'react-addons-test-utils';
import Button from '../src/button';
import expect from 'expect';
import expectJSX from 'expect-jsx';
import assert from 'power-assert';

expect.extend(expectJSX);

describe('Button Component test', () => {
  const renderer = createRenderer();
  it ('Should button rendered Motion component with initial state value', (done) => {
    renderer.render(<Button />)
    const onClick = () => console.log("onclick");
    const actualElement = renderer.getRenderOutput();
    let expectedElement = (
      <Motion style={{scaleX: {config: [1500, 10], val: 1}, scaleY: {config: [1500, 10], val: 1}}} />
    );
    expect(actualElement).toEqualJSX(expectedElement);
    done();
  });

  it ('Should button rendered Motion component with 2nd and 3rd state value, when start()', (done) => {
    renderer.render(<Button />);

    renderer._instance._instance.start()
    setTimeout(() => {
      const actualElement = renderer.getRenderOutput();
      let expectedElement = (
          <Motion style={{scaleX: {config: [1500, 50], val: 0.6}, scaleY: {config: [1500, 50], val: 0.6}}} />
      );
      expect(actualElement).toEqualJSX(expectedElement);
    }, 120);

    setTimeout(() => {
      const actualElement = renderer.getRenderOutput();
      let expectedElement = (
          <Motion style={{scaleX: {config: [1500, 10], val: 1}, scaleY: {config: [1500, 10], val: 1}}} />
      );
      expect(actualElement).toEqualJSX(expectedElement);
      done();
    }, 200);
  });

  it ('Should call onclick callback, when button clicked', (done) => {
    const onClick = () => {
      assert.ok(true);
      done();
    }
    const button = TestUtils.renderIntoDocument(<Button onClick={onClick} />);
    const div = TestUtils.scryRenderedDOMComponentsWithTag(button, 'div');
    TestUtils.Simulate.click(ReactDOM.findDOMNode(div[0]));
  });

  afterEach( done => {
    ReactDOM.unmountComponentAtNode(document.body);
    document.body.innerHTML = "";
    setTimeout(done);
  });
});
{'fraction_non_alphanumeric': 0.15970056144728634, 'fraction_numerical': 0.020898315658140987, 'mean_word_length': 3.866464339908953, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 25, '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': '1735379', 'n_tokens_mistral': 1008, 'n_tokens_neox': 942, 'n_words': 243}