<commit_before>
import React from 'react';
import { shallow, render } from 'enzyme';
import chaiEnzyme from 'chai-enzyme';
import chai, { expect } from 'chai';

import DropdownSelect from '../../../client/jsx/dropdown-select';

chai.use(chaiEnzyme());

// Props with non-default values passes to the component
const props = {
    options: []
};

describe('Component <DropdownSelect>', () => {
    it('should render', () => {
        const wrapper = shallow(<DropdownSelect {...props} />);
        expect(wrapper, 'Component must render with shallow').to.have.length(1);
    });

    it('should have a number of <option>s', () => {
        const props = {
            options: ['good', 'bad', 'ugly', 'rest']
        };
        const wrapper = shallow(<DropdownSelect {...props} />);
        const optElems = wrapper.find('option');
        expect(optElems).to.have.length(4);
    });

    it('should have onChange callback', () => {
        let selOpt = null;
        const props = {options: ['a', 'b'],
            callback: (opt) => {selOpt = opt;},
            currValue: 'xxx'
        };
        const wrapper = shallow(<DropdownSelect {...props} />);
        expect(wrapper.find('select')).to.have.length(1);
    });
});<commit_msg>Added expect check for <select>.<commit_after>
import React from 'react';
import { shallow, render } from 'enzyme';
import chaiEnzyme from 'chai-enzyme';
import chai, { expect } from 'chai';

import DropdownSelect from '../../../client/jsx/dropdown-select';

chai.use(chaiEnzyme());

// Props with non-default values passes to the component
const props = {
    options: []
};

describe('Component <DropdownSelect>', () => {
    it('should render', () => {
        const wrapper = shallow(<DropdownSelect {...props} />);
        expect(wrapper, 'Component must render with shallow').to.have.length(1);
    });

    it('should have a number of <option>s', () => {
        const props = {
            options: ['good', 'bad', 'ugly', 'rest']
        };
        const wrapper = shallow(<DropdownSelect {...props} />);
        const optElems = wrapper.find('option');
        expect(optElems).to.have.length(4);
    });

    it('should have onChange callback', () => {
        let selOpt = null;
        const props = {options: ['a', 'b'],
            callback: (opt) => {selOpt = opt;},
            currValue: 'a'
        };
        const wrapper = shallow(<DropdownSelect {...props} />);
        expect(wrapper.find('select')).to.have.length(1);

        expect(wrapper.find('option').get(0)).to.be.selected;
    });
});
{'fraction_non_alphanumeric': 0.18363351605324982, 'fraction_numerical': 0.00274079874706343, 'mean_word_length': 2.6657101865136297, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 24, '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': '5096028', 'n_tokens_mistral': 774, 'n_tokens_neox': 756, 'n_words': 191}