<commit_before>describe('day names', function() {
  var settings = {};
  var testableClasses = [
    'basicDay',
    'agendaDay'
  ];
  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()
    };
  });

  testableClasses.forEach(function(viewClass, index, viewClasses) {
    describe('when view is basicDay', function() {
      beforeEach(function() {
        settings.defaultView = 'basicDay';
      });

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

        dayClasses.forEach(function(cls, index, classes) {
          var weekdays = moment.weekdays();
          it('should be ' + weekdays[index], function() {
            settings.now = moment(referenceDate).add('days', index);
            $('#cal').fullCalendar(settings);

            expect($('.fc-view thead ' + dayClasses[index])).toHaveText(weekdays[index]);
          });
        });
      });

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

          dayClasses.forEach(function(cls, index, classes) {
            it('should be the translation for ' + moment.weekdays()[index], function() {
              settings.lang = language;
              settings.now = moment(referenceDate).add('days', index);
              $('#cal').fullCalendar(settings);

              expect($('.fc-view thead ' + dayClasses[index])).toHaveText(moment.weekdays()[index]);
            });
          });
        });
      });

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

        dayClasses.forEach(function(cls, idx, classes) {
          it('should be ' + weekdays[idx], function() {
            settings.dayNames = moment.weekdays();
            settings.now = moment(referenceDate).add('days', idx);

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

            expect($('.fc-view thead ' + cls)).toHaveText(moment.weekdays()[idx]);
          });
        });
      });
    });
  });
});<commit_msg>fix problem where calendar dayNames setting wasnt being tested<commit_after>describe('day names', function() {
  var settings = {};
  var testableClasses = [
    'basicDay',
    'agendaDay'
  ];
  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()
    };
  });

  testableClasses.forEach(function(viewClass, index, viewClasses) {
    describe('when view is basicDay', function() {
      beforeEach(function() {
        settings.defaultView = 'basicDay';
      });

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

        dayClasses.forEach(function(cls, index, classes) {
          var weekdays = moment.weekdays();
          it('should be ' + weekdays[index], function() {
            settings.now = moment(referenceDate).add('days', index);
            $('#cal').fullCalendar(settings);

            expect($('.fc-view thead ' + dayClasses[index])).toHaveText(weekdays[index]);
          });
        });
      });

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

          dayClasses.forEach(function(cls, index, classes) {
            it('should be the translation for ' + moment.weekdays()[index], function() {
              settings.lang = language;
              settings.now = moment(referenceDate).add('days', index);
              $('#cal').fullCalendar(settings);

              expect($('.fc-view thead ' + dayClasses[index])).toHaveText(moment.weekdays()[index]);
            });
          });
        });
      });

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

        dayClasses.forEach(function(cls, idx, classes) {
          it('should be ' + weekdays[idx], function() {
            settings.dayNames = [].slice.call(weekdays); // copy. in case there is a mutation
            settings.now = moment(referenceDate).add('days', idx);

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

            expect($('.fc-view thead ' + cls)).toHaveText(weekdays[idx]);
          });
        });
      });
    });
  });
});
{'fraction_non_alphanumeric': 0.17166316593469544, 'fraction_numerical': 0.004582776398701547, 'mean_word_length': 2.073943661971831, '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': '2105734', 'n_tokens_mistral': 1553, 'n_tokens_neox': 1511, 'n_words': 279}