<commit_before>// test utils
import { mount, shallow, render } from 'enzyme';
// Components
import ToolBar, {ToolbarGroup, ToolbarSort} from '../toolbar';

describe('ToolBar components ', () => {
    describe('<ToolBar />', ()=> {
        it('should be a div with a data-focus=toolbar', () => {
            const values = ['truc', 'machin', 'bidule'];
            const toolbarProps = {
                sort: sinon.spy(),
                group: sinon.spy(),
                sortList: values,
                groupList: values
            };
            const wrapper = render(<ToolBar toolbarProps={toolbarProps} selectState={false} toggleAllLine={() => sinon.spy()} />);
            // console.log(wrapper);
            // const div = wrapper.find("div[data-focus='toolbar']");
            // expect(div).to.exist;
        });
    });
    describe('<ToolbarGroup/>', () => {
        it("should have three options if the listeGroup have a length equal to 3 ", ()=> {
            const wrapper = mount(<ToolbarGroup groupList={['truc', 'machin', 'bidule']}/>)
            expect(wrapper.find("[data-focus='dropdown'] ul li")).to.have.length(3);
        })

        it('should call the props group on the change event', ()=> {
            const groupSpy = sinon.spy();
            const wrapper = mount(<ToolbarGroup group={groupSpy} groupList={['truc', 'machin', 'bidule']}/>)
            wrapper.find("[data-focus='dropdown'] ul li").at(0).simulate('click');
            expect(groupSpy).to.have.property('callCount', 1);<commit_msg>optimize toolbar test<commit_after>// test utils
import { mount, shallow, render } from 'enzyme';
// Components
import ToolBar, {ToolbarGroup, ToolbarSort} from '../toolbar';

describe('ToolBar components ', () => {
    describe.only('<ToolBar />', ()=> {
        it('should be a div with a data-focus=toolbar', () => {
            const values = ['truc', 'machin', 'bidule'];
            const toolbarProps = {
                sort: sinon.spy(),
                group: sinon.spy(),
                sortList: values,
                groupList: values
            };
            const wrapper = render(<ToolBar toolbarProps={toolbarProps} selectState={false} toggleAllLine={() => sinon.spy()} />);
            expect(wrapper.find("div[data-focus='toolbar']")).to.exist;
        });
    });
    describe('<ToolbarGroup/>', () => {
        it("should have three options if the listeGroup have a length equal to 3 ", ()=> {
            const wrapper = mount(<ToolbarGroup groupList={['truc', 'machin', 'bidule']}/>)
            expect(wrapper.find("[data-focus='dropdown'] ul li")).to.have.length(3);
        })

        it('should call the props group on the change event', ()=> {
            const groupSpy = sinon.spy();
            const wrapper = mount(<ToolbarGroup group={groupSpy} groupList={['truc', 'machin', 'bidule']}/>)
            wrapper.find("[data-focus='dropdown'] ul li").at(0).simulate('click');
            expect(groupSpy).to.have.property('callCount', 1);
{'fraction_non_alphanumeric': 0.1759228466910542, 'fraction_numerical': 0.002660458929165281, 'mean_word_length': 2.4694348327566322, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 27, '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': '2259682', 'n_tokens_mistral': 864, 'n_tokens_neox': 864, 'n_words': 197}