<commit_before>import moment from 'moment';
import React from 'react/addons';
import Calendar from '../src/Calendar';
import Asserter from './assertions/Asserter';
import chai from 'chai';

const { TestUtils } = React.addons;
const expect = chai.expect;


describe('Calendar', () => {

    const onSelect = function(date) {
        //console.info('onSelect', date);
    };


    it('displays the correct year', () => {
        const calendar = TestUtils.renderIntoDocument(
            <Calendar date={moment('03/04/2015', 'DD/MM/YYYY')} onSelect={onSelect} />
        );

        new Asserter(calendar).assertYear('2015');
    });


    it('displays the correct month', () => {
        const calendar = TestUtils.renderIntoDocument(
            <Calendar date={moment('03/04/2015', 'DD/MM/YYYY')} onSelect={onSelect} />
        );

        new Asserter(calendar).assertMonth('April');
    });


    it('should be able to go to previous month', () => {
        const calendar = TestUtils.renderIntoDocument(
            <Calendar date={moment('03/04/2015', 'DD/MM/YYYY')} onSelect={onSelect} />
        );

        new Asserter(calendar).previousMonth().assertMonth('March');
    });


    it('should be able to go to next month', () => {
        const calendar = TestUtils.renderIntoDocument(
            <Calendar date={moment('03/04/2015', 'DD/MM/YYYY')} onSelect={onSelect} />
        );

        new Asserter(calendar).nextMonth().assertMonth('May');
    });


    it('should trigger the callback with selected date when clicking a day', function(done) {
        const callback = function(selectedDate) {
            expect(moment(selectedDate).format('DD/MM/YYYY')).to.equal('08/04/2015');
            done();
        };

        const calendar = TestUtils.renderIntoDocument(
            <Calendar date={moment('03/04/2015', 'DD/MM/YYYY')} onSelect={callback} />
        );

        new Asserter(calendar).clickDay(8);
    });


    it('should set selected date to selected', () => {
        const date = moment('03/04/2015', 'DD/MM/YYYY');
        const calendar = TestUtils.renderIntoDocument(
            <Calendar date={ date} onSelect={onSelect} />
        );

        new Asserter(calendar).clickDay(8).assertSelectedDay(8);
    });


    it('should add class to today', () => {

    });
});


<commit_msg>refactoring tests<commit_after>import moment from 'moment';
import React from 'react/addons';
import Calendar from '../src/Calendar';
import Asserter from './assertions/Asserter';
import chai from 'chai';

const { TestUtils } = React.addons;
const expect = chai.expect;


describe('Calendar', () => {

    const onSelect = function(date) {
        //console.info('onSelect', date);
    };


    it('displays the correct year', () => {
        const calendar = TestUtils.renderIntoDocument(
            <Calendar date={moment('03/04/2015', 'DD/MM/YYYY')} onSelect={onSelect} />
        );

        new Asserter(calendar).assertYear('2015');
    });


    it('displays the correct month', () => {
        const calendar = TestUtils.renderIntoDocument(
            <Calendar date={moment('03/04/2015', 'DD/MM/YYYY')} onSelect={onSelect} />
        );

        new Asserter(calendar).assertMonth('April');
    });


    it('should be able to go to previous month', () => {
        const calendar = TestUtils.renderIntoDocument(
            <Calendar date={moment('03/04/2015', 'DD/MM/YYYY')} onSelect={onSelect} />
        );

        new Asserter(calendar).previousMonth().assertMonth('March');
    });


    it('should be able to go to next month', () => {
        const calendar = TestUtils.renderIntoDocument(
            <Calendar date={moment('03/04/2015', 'DD/MM/YYYY')} onSelect={onSelect} />
        );

        new Asserter(calendar).nextMonth().assertMonth('May');
    });


    it('should trigger the callback with selected date when clicking a day', function(done) {
        const callback = function(selectedDate) {
            expect(moment(selectedDate).format('DD/MM/YYYY')).to.equal('08/04/2015');
            done();
        };

        const calendar = TestUtils.renderIntoDocument(
            <Calendar date={moment('03/04/2015', 'DD/MM/YYYY')} onSelect={callback} />
        );

        new Asserter(calendar).clickDay(8);
    });


    it('should set selected date to selected', () => {
        const calendar = TestUtils.renderIntoDocument(
            <Calendar date={moment('03/04/2015', 'DD/MM/YYYY')} onSelect={onSelect} />
        );

        new Asserter(calendar).clickDay(8).assertSelectedDay(8);
    });


    it('should add class to today', () => {

    });
});



{'fraction_non_alphanumeric': 0.16298222800173384, 'fraction_numerical': 0.027308192457737322, 'mean_word_length': 2.6949559647718173, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 29, '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': '4294612', 'n_tokens_mistral': 1458, 'n_tokens_neox': 1320, 'n_words': 281}