<commit_before>YUI.add('aui-scheduler-tests', function(Y) {

    var suite = new Y.Test.Suite('aui-scheduler');
    var DateMath = Y.DataType.DateMath;

    var today = new Date();
    var JANUARY_1 = DateMath.getJan1(today.getFullYear());
    var JULY_1 = DateMath.getDate(today.getFullYear(), 6, 1);
    var NO_DST_OFFSET = (JANUARY_1.getTimezoneOffset() === JULY_1.getTimezoneOffset());
    var WEEK_LENGTH = DateMath.WEEK_LENGTH;

    suite.add(new Y.Test.Case({
        name: 'Automated Tests',

        _should: {
            ignore: {
                'should display event in month view in the week DST begins': NO_DST_OFFSET,
                'should display event in month view in the last day of first week under DST': NO_DST_OFFSET,
                'should not display "Show n more" link with only two events': NO_DST_OFFSET,
                'should display last day of event spanning to DST from one week before': NO_DST_OFFSET,
                'should display events spanning into DST correctly in week view when last day of week is the first day under DST': NO_DST_OFFSET
            }
        },

        setUp: function() {
            this._agendaView = new Y.SchedulerAgendaView(),
            this._dayView = new Y.SchedulerDayView(),
            this._monthView = new Y.SchedulerMonthView(),
            this._weekView = new Y.SchedulerWeekView();
        },

        tearDown: function() {
            if (this._scheduler) {
                this._scheduler.destroy();
                delete this._scheduler;
            }
        },

        _clickColgrid: function(index) {
            var colgrid = Y.all('.scheduler-view-table-colgrid').item(index),
                offsetXY = colgrid.getXY();

            // "event-simulate" module does not support pageX/pageY values
            this._monthView._onMouseDownGrid({
                pageX: offsetXY[0]+1,
                pageY: offsetXY[1]+1,
                target: colgrid,
            });
            this._monthView._onMouseUpGrid();
        },

        _createScheduler: function(config) {
            this._scheduler = new Y.Scheduler(Y.merge({
                boundingBox: '#myScheduler',
                date: new Date(2013, 11, 4),
                eventRecorder: new Y.SchedulerEventRecorder(),
                items: [
                    {<commit_msg>AUI-2105 Test: methods for clicking and dragging over day view.<commit_after>YUI.add('aui-scheduler-tests', function(Y) {

    var suite = new Y.Test.Suite('aui-scheduler');
    var DateMath = Y.DataType.DateMath;

    var today = new Date();
    var JANUARY_1 = DateMath.getJan1(today.getFullYear());
    var JULY_1 = DateMath.getDate(today.getFullYear(), 6, 1);
    var NO_DST_OFFSET = (JANUARY_1.getTimezoneOffset() === JULY_1.getTimezoneOffset());
    var WEEK_LENGTH = DateMath.WEEK_LENGTH;

    suite.add(new Y.Test.Case({
        name: 'Automated Tests',

        _should: {
            ignore: {
                'should display event in month view in the week DST begins': NO_DST_OFFSET,
                'should display event in month view in the last day of first week under DST': NO_DST_OFFSET,
                'should not display "Show n more" link with only two events': NO_DST_OFFSET,
                'should display last day of event spanning to DST from one week before': NO_DST_OFFSET,
                'should display events spanning into DST correctly in week view when last day of week is the first day under DST': NO_DST_OFFSET
            }
        },

        setUp: function() {
            this._agendaView = new Y.SchedulerAgendaView(),
            this._dayView = new Y.SchedulerDayView(),
            this._monthView = new Y.SchedulerMonthView(),
            this._weekView = new Y.SchedulerWeekView();
        },

        tearDown: function() {
            if (this._scheduler) {
                this._scheduler.destroy();
                delete this._scheduler;
            }
        },

        _clickColgrid: function(index) {
            var colgrid = Y.all('.scheduler-view-table-colgrid').item(index),
                offsetXY = colgrid.getXY();

            // "event-simulate" module does not support pageX/pageY values
            this._monthView._onMouseDownGrid({
                pageX: offsetXY[0]+1,
                pageY: offsetXY[1]+1,
                target: colgrid,
            });
            this._monthView._onMouseUpGrid();
        },

        _clickColShim: function(x, y) {
            var colShim = Y.one('.scheduler-view-day-table-col-shim'),
                offsetXY = colShim.getXY();

            this._dayView._onGestureMoveStartTableCol({
                pageX: offsetXY[0]+x,
                pageY: offsetXY[1]+y,
                currentTarget: colShim,
                target: colShim,
                halt: Y.Lang.emptyFn,
                _event: {}
            });
        },

        _dragOverColShim: function(x, y) {
            var colShim = Y.one('.scheduler-view-day-table-col-shim'),
                offsetXY = colShim.getXY();

            this._dayView._onGestureMoveTableCol({
                pageX: offsetXY[0]+x,
                pageY: offsetXY[1]+y,
                currentTarget: colShim,
                target: colShim,
                halt: Y.Lang.emptyFn
            });
        },

        _releaseColShim: function() {
            this._dayView._onGestureMoveEndTableCol();
        },

        _createScheduler: function(config) {
            this._scheduler = new Y.Scheduler(Y.merge({
                boundingBox: '#myScheduler',
                date: new Date(2013, 11, 4),
                eventRecorder: new Y.SchedulerEventRecorder(),
                items: [
                    {
{'fraction_non_alphanumeric': 0.10275293705067508, 'fraction_numerical': 0.007715237594248641, 'mean_word_length': 1.7988223748773307, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '238515', 'n_tokens_mistral': 1705, 'n_tokens_neox': 1616, 'n_words': 391}