"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.LOCALES_YEAR_UNFORMATTED = void 0;
var _LocaleUtils = _interopRequireDefault(require("./LocaleUtils"));
var LOCALES_YEAR_UNFORMATTED = exports.LOCALES_YEAR_UNFORMATTED = ['cs', 'da', 'de', 'el', 'en', 'es', 'fi', 'fr', 'he', 'hi', 'id', 'it', 'lt', 'ms', 'nl', 'no', 'pl', 'pt', 'ro', 'ru', 'sv', 'tl', 'tr', 'uk', 'vi'];
var FORMATTED_YEAR_TEST_DATA = [{
  locale: 'ko',
  expectedYear: '2022년'
}, {
  locale: 'ja',
  expectedYear: '2022年'
}, {
  locale: 'ar',
  expectedYear: '2022'
}, {
  locale: 'bg',
  expectedYear: '2022 г.'
}, {
  locale: 'hu',
  expectedYear: '2022.'
}, {
  locale: 'th',
  expectedYear: 'พ.ศ. 2565'
}, {
  locale: 'zh',
  expectedYear: '2022年'
}];
var FORMATTED_WEEKDAY_SHORT_TEST_DATA = [{
  locale: 'ko',
  expectedWeekday: '월'
}, {
  locale: 'ko-kr',
  expectedWeekday: '월'
}, {
  locale: 'ar',
  expectedWeekday: 'ن'
}, {
  locale: 'ar-jo',
  expectedWeekday: 'ن'
}, {
  locale: 'he',
  expectedWeekday: 'ב׳'
}, {
  locale: 'he-il',
  expectedWeekday: 'ב׳'
}];
describe('LocaleUtils', () => {
  var year = new Date('2022-01-01T00:00:00Z');
  var _loop = function _loop(testData) {
    it("".concat(testData.locale, " locale"), () => {
      var localeUtils = (0, _LocaleUtils.default)(testData.locale);
      var result = localeUtils.formatYear(year);
      expect(result).toBe(testData.expectedYear);
    });
  };
  for (var testData of FORMATTED_YEAR_TEST_DATA) {
    _loop(testData);
  }
  it('should return unformatted year', () => {
    var _loop2 = function _loop2(locale) {
      var getLocaleUtilsFactory = () => (0, _LocaleUtils.default)(locale);
      var localeUtils = getLocaleUtilsFactory();
      var result = localeUtils.formatYear(year);
      expect(result).toBe('2022');
    };
    for (var locale of LOCALES_YEAR_UNFORMATTED) {
      _loop2(locale);
    }
  });
  var _loop3 = function _loop3(_testData) {
    it("".concat(_testData.locale, " locale should return formatted week days"), () => {
      var localeUtils = (0, _LocaleUtils.default)(_testData.locale);
      var result = localeUtils.formatWeekdayShort(1);
      expect(result).toBe(_testData.expectedWeekday);
    });
  };
  for (var _testData of FORMATTED_WEEKDAY_SHORT_TEST_DATA) {
    _loop3(_testData);
  }
});
//# sourceMappingURL=LocaleUtils.spec.js.map