<commit_before>var jsdom = require('mocha-jsdom');
var expect = require('expect');
var $ = require('jquery');

describe('DatePickerInput', function() {
  jsdom();

  it('presents the DatePicker when clicking on the calendar button', function() {
    var React = require('react/addons');
    var {DatePickerInput, DatePicker} = require('../dist/react-semantic-datepicker.min.js');
    var TestUtils = React.addons.TestUtils;

    var inputWrapper = TestUtils.renderIntoDocument(
      <div className='ui input'>
        <DatePickerInput onChange={() => {}} />
      </div>
    );

    var datePickers = TestUtils.scryRenderedComponentsWithType(inputWrapper, DatePicker);
    expect(datePickers.length).toBe(0);

    var calendarButton = TestUtils.findRenderedDOMComponentWithClass(inputWrapper, 'ui icon button');
    TestUtils.Simulate.click(calendarButton);

    var datePickers = TestUtils.scryRenderedComponentsWithType(inputWrapper, DatePicker);
    expect(datePickers.lenght).toBe(1, "DatePicker was not displayed after clicking on the calendar button");

  });
});
<commit_msg>defined test for display datepicker when clicking on the input area<commit_after>var jsdom = require('mocha-jsdom');
var expect = require('expect');
var $ = require('jquery');

describe('DatePickerInput', function() {
  jsdom();

  it('presents the DatePicker when clicking on the calendar button', function() {
    var React = require('react/addons');
    var {DatePickerInput, DatePicker} = require('../dist/react-semantic-datepicker.min.js');
    var TestUtils = React.addons.TestUtils;

    var inputWrapper = TestUtils.renderIntoDocument(
      <div className='ui input'>
        <DatePickerInput onChange={() => {}} />
      </div>
    );

    var datePickers = TestUtils.scryRenderedComponentsWithType(inputWrapper, DatePicker);
    expect(datePickers.length).toBe(0);

    var calendarButton = TestUtils.findRenderedDOMComponentWithClass(inputWrapper, 'ui icon button');
    TestUtils.Simulate.click(calendarButton);

    var datePickers = TestUtils.scryRenderedComponentsWithType(inputWrapper, DatePicker);
    expect(datePickers.lenght).toBe(1, "DatePicker was not displayed after clicking on the calendar button");

  });

  it('presents the DatePicker when clicking on the input area', function() {
    var React = require('react/addons');
    var {DatePickerInput, DatePicker} = require('../dist/react-semantic-datepicker.min.js');
    var TestUtils = React.addons.TestUtils;

    var inputWrapper = TestUtils.renderIntoDocument(
      <div className='ui input'>
        <DatePickerInput onChange={() => {}} />
      </div>
    );

    var datePickers = TestUtils.scryRenderedComponentsWithType(inputWrapper, DatePicker);
    expect(datePickers.length).toBe(0);

    var datePickerInputArea = TestUtils.findRenderedDOMComponentWithTag(inputWrapper, 'input');
    TestUtils.Simulate.click(datePickerInputArea);

    var datePickers = TestUtils.scryRenderedComponentsWithType(inputWrapper, DatePicker);
    expect(datePickers.lenght).toBe(1, "DatePicker was not displayed after clicking on the input area");

  });


});

{'fraction_non_alphanumeric': 0.12423756019261638, 'fraction_numerical': 0.0019261637239165329, 'mean_word_length': 4.655172413793103, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 15, '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': '3841677', 'n_tokens_mistral': 904, 'n_tokens_neox': 871, 'n_words': 198}