<commit_before>/*
 * A note about these tests:
 *
 * These tests are specifically only testing that the correct calls are being made
  * to unexpected-htmllike, and that the output is correctly returned.
  * They also test the integration with the unexpected-htmllike-rendered-react-adapter
  * There are many, many more cases for specific diffing cases in the tests for
  * `unexpected-htmllike`
 */

const EmulateDom = require( '../testHelpers/emulateDom');

const Unexpected = require('unexpected');
const UnexpectedReact = require('../unexpected-react');

const React = require('react');
const TestUtils = require('react-addons-test-utils');
const { findDOMNode } = require('react-dom');

const expect = Unexpected.clone()
    .use(UnexpectedReact);

const PropTypes = React.PropTypes;

expect.output.preferredWidth = 80;

class CustomComp extends React.Component {

    constructor() {
        super();
        this.state = {
            clickCount: 0
        };
        this.onClick = this.onClick.bind(this);
    }

    onClick(event) {
        event.preventDefault();  // Used to check that we get the event properly
        this.setState({
            clickCount: this.state.clickCount + 1
        });
    }

    render() {
        let children = null;
        if (this.props.childCount) {
            children = [];
            for(let i = 1; i <= this.props.childCount; ++i) {
                children.push(<span key={i} className={'' + i}>{null}{i}</span>);
            }
        }
        // If onClick was passed, add it as a prop, otherwise, leave it undefined
        const extraProps = {};
        if (this.props.useEvents) {
            extraProps.onClick = this.onClick;
            extraProps['data-click-count'] = this.state.clickCount;
        }

        return (
            <div
                className={this.props.className}
                {...extraProps}
            >
                {children}
            </div>
        );
    }
}

CustomComp.propTypes = {
    childCount: PropTypes.number,
    className: PropTypes.string,
    useEvents: PropTypes.boolean
};

class WrapperComp extends React.Component {
    render() {
        return <CustomComp {...this.props} />;
    }
}

class MyDiv extends React.Component {<commit_msg>Fix incorrect PropType name (boolean -> bool)<commit_after>/*
 * A note about these tests:
 *
 * These tests are specifically only testing that the correct calls are being made
  * to unexpected-htmllike, and that the output is correctly returned.
  * They also test the integration with the unexpected-htmllike-rendered-react-adapter
  * There are many, many more cases for specific diffing cases in the tests for
  * `unexpected-htmllike`
 */

const EmulateDom = require( '../testHelpers/emulateDom');

const Unexpected = require('unexpected');
const UnexpectedReact = require('../unexpected-react');

const React = require('react');
const TestUtils = require('react-addons-test-utils');
const { findDOMNode } = require('react-dom');

const expect = Unexpected.clone()
    .use(UnexpectedReact);

const PropTypes = React.PropTypes;

expect.output.preferredWidth = 80;

class CustomComp extends React.Component {

    constructor() {
        super();
        this.state = {
            clickCount: 0
        };
        this.onClick = this.onClick.bind(this);
    }

    onClick(event) {
        event.preventDefault();  // Used to check that we get the event properly
        this.setState({
            clickCount: this.state.clickCount + 1
        });
    }

    render() {
        let children = null;
        if (this.props.childCount) {
            children = [];
            for(let i = 1; i <= this.props.childCount; ++i) {
                children.push(<span key={i} className={'' + i}>{null}{i}</span>);
            }
        }
        // If onClick was passed, add it as a prop, otherwise, leave it undefined
        const extraProps = {};
        if (this.props.useEvents) {
            extraProps.onClick = this.onClick;
            extraProps['data-click-count'] = this.state.clickCount;
        }

        return (
            <div
                className={this.props.className}
                {...extraProps}
            >
                {children}
            </div>
        );
    }
}

CustomComp.propTypes = {
    childCount: PropTypes.number,
    className: PropTypes.string,
    useEvents: PropTypes.bool
};

class WrapperComp extends React.Component {
    render() {
        return <CustomComp {...this.props} />;
    }
}

class MyDiv extends React.Component {
{'fraction_non_alphanumeric': 0.11798371120405018, 'fraction_numerical': 0.002201188641866608, 'mean_word_length': 2.2503576537911303, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 14, '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': '3298927', 'n_tokens_mistral': 1268, 'n_tokens_neox': 1250, 'n_words': 341}