<commit_before>describe('short month name', function() {
  var settings = {};
  var referenceDate = '2014-01-01 06:00'; // The day the world is hung-over
  var languages = [ 'es', 'fr', 'de', 'zh-cn', 'nl' ];

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

  afterEach(function() {
    moment.lang('en'); // reset moment's global language
  });

  [ 'agendaWeek', 'basicWeek' ].forEach(function(viewClass, index, viewClasses) {
    describe('when view is ' + viewClass, function() {
      beforeEach(function() {
        settings.defaultView = viewClass;
      });

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

        moment.monthsShort().forEach(function(month, index, months) {
          it('should be ' + months[index], function(done) {
            settings.now = moment(referenceDate).add('months', index);
            settings.eventAfterAllRender = function() {
              expect($('.fc-header-title')[0]).toContainText(moment.monthsShort()[index]);
              done();
            };

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

      languages.forEach(function(language, index, languages) {
        describe('when lang is ' + language, function() {
          beforeEach(function() {
            settings.lang = language;
            moment.lang(language);
          });

          moment.monthsShort().forEach(function(month, index, months) {
            it('should be the translated name for ' + months[index], function(done) {
              settings.now = moment(referenceDate).add('months', index);
              settings.eventAfterAllRender = function() {
                expect($('.fc-header-title')[0]).toContainText(moment.monthsShort()[index]);
                done();
              };

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

      describe('when names are specified', function() {
        var monthsShort = [
          'I',
          'II',
          'III',
          'IV',
          'V',
          'VI',
          'VII',
          'IIX',
          'IX',
          'X',
          'XI',
          'XII'
        ];

        monthsShort.forEach(function(month, index, months) {
          it('should be the translated name for ' + months[index], function(done) {
            settings.now = moment(referenceDate).add('months', index);
            settings.monthNamesShort = months;
            settings.eventAfterAllRender = function() {
              expect($('.fc-header-title')[0]).toContainText(month);
              done();
            };

            $('#cal').fullCalendar(settings);<commit_msg>tweaks to monthNamesShort test<commit_after>describe('short month name', function() {
  var settings = {};
  var referenceDate = '2014-01-01'; // The day the world is hung-over
  var languages = [ 'es', 'fr', 'de', 'zh-cn', 'nl' ];

  beforeEach(function() {
    affix('#cal');
    settings = {
      defaultDate: referenceDate
    };
  });

  afterEach(function() {
    moment.lang('en'); // reset moment's global language
  });

  [ 'agendaWeek', 'basicWeek' ].forEach(function(viewClass, index, viewClasses) {
    describe('when view is ' + viewClass, function() {
      beforeEach(function() {
        settings.defaultView = viewClass;
      });

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

        moment.monthsShort().forEach(function(monthShort, index) {
          it('should be ' + monthShort, function(done) {
            settings.defaultDate = $.fullCalendar.moment(referenceDate).add('months', index);
            settings.eventAfterAllRender = function() {
              expect($('.fc-header-title')[0]).toContainText(monthShort);
              done();
            };

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

      languages.forEach(function(language, index, languages) {
        describe('when lang is ' + language, function() {
          beforeEach(function() {
            settings.lang = language;
            moment.lang(language);
          });

          moment.monthsShort().forEach(function(monthShort, index) { // `monthShort` will always be English
            it('should be the translated name for ' + monthShort, function(done) {
              var langMonthsShort = moment.monthsShort();
              var langMonthShort = langMonthsShort[index];

              settings.defaultDate = $.fullCalendar.moment(referenceDate).add('months', index);
              settings.eventAfterAllRender = function() {
                expect($('.fc-header-title')[0]).toContainText(langMonthShort);
                done();
              };

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

      describe('when names are specified', function() {
        var monthsShort = [
          'I',
          'II',
          'III',
          'IV',
          'V',
          'VI',
          'VII',
          'IIX',
          'IX',
          'X',
          'XI',
          'XII'
        ];

        monthsShort.forEach(function(monthShort, index) { // `monthShort` will be our custom month name
          it('should be the translated name for ' + monthShort, function(done) {
            settings.defaultDate = $.fullCalendar.moment(referenceDate).add('months', index);
            settings.monthNamesShort = monthsShort;
            settings.eventAfterAllRender = function() {
              expect($('.fc-header-title')[0]).toContainText(monthShort);
              done();
            };

            $('#cal').fullCalendar(settings);
{'fraction_non_alphanumeric': 0.15272789464682743, 'fraction_numerical': 0.004446724816145032, 'mean_word_length': 1.9943676395289298, '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': '4650408', 'n_tokens_mistral': 1577, 'n_tokens_neox': 1521, 'n_words': 300}