<commit_before>import * as React from 'react';
import * as renderer from 'react-test-renderer';
import { Button } from './Button';

describe('Button', () => {
    it('should create and render a button with text', () => {
        const text = 'My button.';
        const element = <Button>{text}</Button>;
        const tree = renderer.create(element).toJSON();
        expect(tree.children[0]).toEqual(text);
    });
});<commit_msg>chore(test): 100% coverage on Button<commit_after>import * as React from 'react';
import * as Enzyme from 'enzyme';
import ReactTestUtils from 'react-dom/test-utils';
import * as renderer from 'react-test-renderer';
import { Button } from './Button';

describe('Button', () => {
    it('should create and render a button with text', () => {
        const text = 'My Button';
        const element = <Button>{text}</Button>;
        const tree = renderer.create(element).toJSON();
        expect(tree.children[0]).toEqual(text);
    });

    it('handles click events', done => {
        const e = <Button onClick={() => done()}>asdf</Button>;
        Enzyme.mount(e).simulate('click');
    });

    it('works without onClick', () => {
        const e = <Button>asdf</Button>;
        Enzyme.mount(e).simulate('click');
    });
});
{'fraction_non_alphanumeric': 0.17922283901665345, 'fraction_numerical': 0.003965107057890563, 'mean_word_length': 3.2348993288590604, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 18, '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': '1764204', 'n_tokens_mistral': 373, 'n_tokens_neox': 366, 'n_words': 98}