"use strict";

var DateHelper = require('./date.helper');
var dateString = '2020-03-16T20:39:54.000';
describe('Date Helper', function () {
  describe('Format Date', function () {
    it('should format the date without time', function () {
      expect(DateHelper.formatDate(dateString)).toBe('Mar 16, 2020');
    });
    it('should format the date with the time', function () {
      var hour = new Date(dateString).getHours() - 12;
      expect(DateHelper.formatDate(dateString, DateHelper.DATETIME_FORMAT)).toBe("Mar 16, 2020 ".concat(hour, ":39 PM"));
    });
  });
  describe('Validate Date', function () {
    it('should validate the date', function () {
      expect(DateHelper.validateDate(dateString)).toBe(true);
      expect(DateHelper.validateDate('4000-03-16')).toBe(false);
    });
  });
});