<commit_before>import React from 'react';
import { expect } from 'chai';
import { shallow } from 'enzyme';
import PageCard from 'components/PageCard';
import SelectionTable from './';

describe('<SelectionTable />', () => {
  it('renders the root Level and title', () => {
    const selectionTable = <SelectionTable title="Classroom">
      <SelectionTable.Level label="CN" />
      <SelectionTable.Level label="RU" />
    </SelectionTable>;
    const wrapper = shallow(selectionTable);
    expect(wrapper.find(SelectionTable.Level)).to.have.length(2);
    expect(wrapper.find(PageCard.Heading)).to.have.length(1);
  });

});<commit_msg>[selection tablle] basic Unit Test<commit_after>import React from 'react';
import { expect } from 'chai';
import { mount } from 'enzyme';
import PageCard from 'components/PageCard';
import SelectionTable from './';

describe('<SelectionTable />', () => {
  it('renders the root Level and title', () => {
    const selectionTableTitle = 'Classroom';
    const selectionTable = <SelectionTable title={selectionTableTitle}>
      <SelectionTable.Level label="CN" />
      <SelectionTable.Level label="RU" />
    </SelectionTable>;
    const wrapper = mount(selectionTable);
    expect(wrapper.find(SelectionTable.Level)).to.have.length(2);
    expect(wrapper.find(PageCard.Heading)).to.have.prop('text', selectionTableTitle);
  });

  it('render sub-Level once a level is clicked', () => {
    const selectionTable = <SelectionTable>
      <SelectionTable.Level label="CN">
        <SelectionTable.Level label="CN-1" />
        <SelectionTable.Level label="CN-2" />
        <SelectionTable.Level label="CN-3" />
      </SelectionTable.Level>
      <SelectionTable.Level label="RU">
        <SelectionTable.Level label="CN-1" />
      </SelectionTable.Level>
    </SelectionTable>;

    const wrapper = mount(selectionTable);
    expect(wrapper.find(SelectionTable.Level)).to.have.length(2);
    wrapper.find(SelectionTable.Level).first().simulate('click');
    expect(wrapper.find(SelectionTable.Level)).to.have.length(3);
    expect(wrapper.find(SelectionTable.Level).first()).to.have.prop('label', 'CN-1');
  });

});
{'fraction_non_alphanumeric': 0.1630283325592197, 'fraction_numerical': 0.004644681839294009, 'mean_word_length': 4.177884615384615, 'pattern_counts': {'":': 0, '<': 23, '<?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': '2874046', 'n_tokens_mistral': 621, 'n_tokens_neox': 611, 'n_words': 121}