<commit_before>describe('day names', function() {
  var settings = {};
  var dayClasses = [
    '.fc-sun',
    '.fc-mon',
    '.fc-tue',
    '.fc-wed',
    '.fc-thu',
    '.fc-fri',
    '.fc-sat',
  ];
  var referenceDate = '2014-05-25 06:00'; // A sunday

  beforeEach(function() {
    affix('#cal');
    moment.lang()
    settings = { }
    settings.now = moment(referenceDate).toISOString();
  });

  describe('when view is basicDay', function() {
    beforeEach(function() {
      settings.defaultView = 'basicDay';
    });

    describe('when lang is default', function() {
      beforeEach(function() {
        settings.lang = 'en';
      });

      $.each(moment.weekdays(), function(index, weekday) {
        it('should be ' + weekday, function() {
          settings.now = moment(referenceDate).add('days', index);
          $('#cal').fullCalendar(settings);
  
          expect($('.fc-day-header')[0]).toHaveText(weekday);
        });
      });
    });
  
    var languages = [ 'es', 'fr', 'de', 'zh-cn', 'nl' ];
    $.each(languages, function(index, language) {
      describe('when lang is ' + language, function() {
        beforeEach(function() {
          moment.lang(language);
        });

        $.each(moment.weekdays(), function(index, weekday) {
          it('should be the translation for ' + weekday, function() {
            var weekdays = moment.weekdays();
            var dow = moment.langData(language)._week.dow
  
            settings.lang = language;
            settings.now = moment(referenceDate).add('days', index);
            $('#cal').fullCalendar(settings);
    
            expect($('.fc-day-header')[0]).toHaveText(weekdays[index])
          });
        });
      });
    });

    describe('when daynames are specified', function() {
      var weekdays = [
        'Hovjaj',
        'maSjaj',
        'veSjaj',
        'mechjaj',
        'jevjaj',
        'parmaqjaj',
        'HoSjaj'
      ];

      $.each(weekdays, function(index, weekday) {
        it('should be ' + weekday, function() {
          settings.dayNames = weekdays;
          settings.now = moment(referenceDate).add('days', index);

          $('#cal').fullCalendar(settings);
  
          expect($('.fc-day-header')[0]).toHaveText(weekday)
        });
      });
    });
  });

  describe('when view is agendaDay', function() {
    beforeEach(function() {
      settings.defaultView = 'agendaDay';
    });

    describe('when lang is default', function() {
      beforeEach(function() {
        moment.lang('en');
        settings.lang = 'en';
      });

      $.each(moment.weekdays(), function(index, weekday) {
        it('should be ' + weekday, function() {
          settings.now = moment(referenceDate).add('days', index);
          $('#cal').fullCalendar(settings);

          var itemClasses = '.fc-col0.fc-widget-header';
          expect($(itemClasses)[0]).toContainText(weekday);
        });
      });
    });

    var languages = [ 'es' ];
    $.each(languages, function(index, language) {
      describe('when lang is ' + language, function() {
        beforeEach(function() {
          moment.lang(language);
        });

        $.each(moment.weekdays(), function(index, weekday) {
          it('should be the translation for ' + weekday, function() {
            var weekdays = moment.weekdays();
            var dow = moment.langData(language)._week.dow

            settings.lang = language;
            settings.now = moment(referenceDate).add('days', index); // move to beforeEach
            $('#cal').fullCalendar(settings);

            var dayClasses = '.fc-col0.fc-widget-header';
            expect($(dayClasses)[0]).toContainText(weekdays[index]);
          });
        });
      });
    });

    describe('when daynames are specified', function() {
      var weekdays = [
        'Hovjaj',
        'maSjaj',
        'veSjaj',
        'mechjaj',
        'jevjaj',
        'parmaqjaj',
        'HoSjaj'
      ];

      $.each(weekdays, function(index, weekday) {
        it('should be ' + weekday, function() {
          settings.dayNames = weekdays;
          settings.now = moment(referenceDate).add('days', index);

          $('#cal').fullCalendar(settings);
  
          var dayClasses = '.fc-col0.fc-widget-header';<commit_msg>Cleaning up dayNames test to pass ```grunt check```<commit_after>describe('day names', function() {
  var settings = {};
  var dayClasses = [
    '.fc-sun',
    '.fc-mon',
    '.fc-tue',
    '.fc-wed',
    '.fc-thu',
    '.fc-fri',
    '.fc-sat',
  ];
  var referenceDate = '2014-05-25 06:00'; // A sunday
  var languages = [ 'es', 'fr', 'de', 'zh-cn', 'nl' ];

  beforeEach(function() {
    affix('#cal');
    moment.lang();
    settings = {
      now: moment(referenceDate).toISOString()
    };
  });

  describe('when view is basicDay', function() {
    beforeEach(function() {
      settings.defaultView = 'basicDay';
    });

    describe('when lang is default', function() {
      beforeEach(function() {
        settings.lang = 'en';
      });

      $.each(moment.weekdays(), function(index, weekday) {
        it('should be ' + weekday, function() {
          settings.now = moment(referenceDate).add('days', index);
          $('#cal').fullCalendar(settings);

          expect($('.fc-day-header')[0]).toHaveText(weekday);
        });
      });
    });

    $.each(languages, function(index, language) {
      describe('when lang is ' + language, function() {
        beforeEach(function() {
          moment.lang(language);
        });

        $.each(moment.weekdays(), function(index, weekday) {
          it('should be the translation for ' + weekday, function() {
            var weekdays = moment.weekdays();

            settings.lang = language;
            settings.now = moment(referenceDate).add('days', index);
            $('#cal').fullCalendar(settings);

            expect($('.fc-day-header')[0]).toHaveText(weekdays[index]);
          });
        });
      });
    });

    describe('when daynames are specified', function() {
      var weekdays = [
        'Hovjaj',
        'maSjaj',
        'veSjaj',
        'mechjaj',
        'jevjaj',
        'parmaqjaj',
        'HoSjaj'
      ];

      $.each(weekdays, function(index, weekday) {
        it('should be ' + weekday, function() {
          settings.dayNames = weekdays;
          settings.now = moment(referenceDate).add('days', index);

          $('#cal').fullCalendar(settings);

          expect($('.fc-day-header')[0]).toHaveText(weekday);
        });
      });
    });
  });

  describe('when view is agendaDay', function() {
    beforeEach(function() {
      settings.defaultView = 'agendaDay';
    });

    describe('when lang is default', function() {
      beforeEach(function() {
        moment.lang('en');
      });

      $.each(moment.weekdays(), function(index, weekday) {
        it('should be ' + weekday, function() {
          settings.lang = 'en';
          settings.now = moment(referenceDate).add('days', index);
          $('#cal').fullCalendar(settings);

          var itemClasses = '.fc-col0.fc-widget-header';
          expect($(itemClasses)[0]).toContainText(weekday);
        });
      });
    });

    $.each(languages, function(index, language) {
      describe('when lang is ' + language, function() {
        beforeEach(function() {
          moment.lang(language);
        });

        $.each(moment.weekdays(), function(index, weekday) {
          it('should be the translation for ' + weekday, function() {
            var weekdays = moment.weekdays();

            settings.lang = language;
            settings.now = moment(referenceDate).add('days', index); // move to beforeEach
            $('#cal').fullCalendar(settings);

            var dayClasses = '.fc-col0.fc-widget-header';
            expect($(dayClasses)[0]).toContainText(weekdays[index]);
          });
        });
      });
    });

    describe('when daynames are specified', function() {
      var weekdays = [
        'Hovjaj',
        'maSjaj',
        'veSjaj',
        'mechjaj',
        'jevjaj',
        'parmaqjaj',
        'HoSjaj'
      ];

      $.each(weekdays, function(index, weekday) {
        it('should be ' + weekday, function() {
          settings.dayNames = weekdays;
          settings.now = moment(referenceDate).add('days', index);

          $('#cal').fullCalendar(settings);

          var dayClasses = '.fc-col0.fc-widget-header';
{'fraction_non_alphanumeric': 0.17345847689200428, 'fraction_numerical': 0.004752287038137104, 'mean_word_length': 2.152808988764045, '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': '4894178', 'n_tokens_mistral': 2538, 'n_tokens_neox': 2477, 'n_words': 449}