<commit_before><commit_msg>feat(Logout):added tests<commit_after>import React from 'react'
import { shallow } from 'enzyme'
import Logout from '../../app/components/Logout'

function setup() {
    const props = {
        onLogoutClick: jest.fn()
    };

    const enzymeWrapper = shallow(<Logout {...props} />);
    return {
        props,
        enzymeWrapper
    }
}

describe('components', () => {
    describe('Logout', () => {
        it('should render logout button', () => {
            const { enzymeWrapper } = setup();
            expect(enzymeWrapper.find('button').length).toBe(1);
            expect(enzymeWrapper.find('button').text()).toBe('Logout');
        });
        it('should call onLogoutClick', () => {
            const { enzymeWrapper, props } = setup();
            enzymeWrapper.find('button').simulate('click');

            expect(props.onLogoutClick.mock.calls.length).toBe(1);
        });
    });
});
{'fraction_non_alphanumeric': 0.17381974248927037, 'fraction_numerical': 0.002145922746781116, 'mean_word_length': 2.520754716981132, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 8, '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': '7142712', 'n_tokens_mistral': 275, 'n_tokens_neox': 259, 'n_words': 46}