<commit_before>import renderer from 'react-test-renderer';

import Menu     from './apps/menu';
import Content  from './apps/Content';
import Footer   from './apps/Footer';

jest.mock('./apps/menu', () => 'MenuMock');
jest.mock('./apps/Content', () => 'Content');
jest.mock('./apps/Footer', () => 'Footer');

import Index from './index';

let mockComponent,
    container;

describe('index module', function() {
    beforeEach(() => {
        container = document.createElement('div');
    });

    it('should properly initialised', () => {
        expect(Index).toBeDefined();
    });

    it('should render Menu without crash', () => {
        // GIVEN
        container.id = 'bookstore-menu';
        mockComponent = renderer.create(
            <Menu />
        );

        // WHEN
        ReactDOM.render(
            <Menu />,
            container
        );

        // THEN
        expect(mockComponent).toMatchSnapshot();
    });

    it('should render Content without crash', () => {
        // GIVEN
        container.id = 'bookstore-content';
        mockComponent = renderer.create(
            <Content />
        );

        // WHEN
        ReactDOM.render(
            <Content />,
            container
        );

        // THEN
        expect(mockComponent).toMatchSnapshot();
    });

    it('should render Footer without crash', () => {
        // GIVEN
        container.id = 'bookstore-footer';
        mockComponent = renderer.create(
            <Footer />
        );

        // WHEN
        ReactDOM.render(
            <Footer />,
            container
        );

        // THEN
        expect(mockComponent).toMatchSnapshot();
    });
});<commit_msg>simplify index.test.js<commit_after>import Menu     from './apps/menu';
import Content  from './apps/Content';
import Footer   from './apps/Footer';

jest.mock('./apps/menu', () => 'MenuMock');
jest.mock('./apps/Content', () => 'Content');
jest.mock('./apps/Footer', () => 'Footer');

import Index from './index';

let mockComponent,
    container;

describe('index module', function() {
    const expectedResult = 'This isn\'t crashed';

    beforeEach(() => {
        // GIVEN
        container = document.createElement('div');
    });

    it('should properly initialised', () => {
        expect(Index).toBeDefined();
    });

    it('should be able to render Menu component without crash', () => {
        // WHEN
        ReactDOM.render(
            <Menu />,
            container
        );

        // THEN
        expect(expectedResult).toEqual(expectedResult);
    });

    it('should be able to Content component without crash', () => {
        // WHEN
        ReactDOM.render(
            <Content />,
            container
        );

        // THEN
        expect(expectedResult).toEqual(expectedResult);
    });

    it('should be able to Footer component without crash', () => {
        // WHEN
        ReactDOM.render(
            <Footer />,
            container
        );

        // THEN
        expect(expectedResult).toEqual(expectedResult);
    });
});
{'fraction_non_alphanumeric': 0.15774003919007185, 'fraction_numerical': 0.0, 'mean_word_length': 1.8440111420612812, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 28, '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': '3479709', 'n_tokens_mistral': 848, 'n_tokens_neox': 818, 'n_words': 175}