"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.n = function(module) {
        var getter = module && module.__esModule ? function() {
            return module['default'];
        } : function() {
            return module;
        };
        __webpack_require__.d(getter, {
            a: getter
        });
        return getter;
    };
})();
(()=>{
    __webpack_require__.d = function(exports1, definition) {
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = function(obj, prop) {
        return Object.prototype.hasOwnProperty.call(obj, prop);
    };
})();
var __webpack_exports__ = {};
const external_dayjs_namespaceObject = require("dayjs");
var external_dayjs_default = /*#__PURE__*/ __webpack_require__.n(external_dayjs_namespaceObject);
const external_util_js_namespaceObject = require("../util.js");
describe('getDateRanges', ()=>{
    const dateRanges = (0, external_util_js_namespaceObject.getDateRanges)();
    it('today', ()=>{
        const [start, end] = dateRanges.today();
        expect(start.toISOString()).toBe(external_dayjs_default()().startOf('day').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().endOf('day').toISOString());
    });
    test('yesterday', ()=>{
        const [start, end] = dateRanges.yesterday();
        expect(external_dayjs_default()(start).isSame(external_dayjs_default()().subtract(1, 'day'), 'day')).toBe(true);
        expect(external_dayjs_default()(end).isSame(external_dayjs_default()().subtract(1, 'day'), 'day')).toBe(true);
    });
    test('tomorrow', ()=>{
        const [start, end] = dateRanges.tomorrow();
        expect(external_dayjs_default()(start).isSame(external_dayjs_default()().add(1, 'day'), 'day')).toBe(true);
        expect(external_dayjs_default()(end).isSame(external_dayjs_default()().add(1, 'day'), 'day')).toBe(true);
    });
    it('lastWeek', ()=>{
        const [start, end] = dateRanges.lastWeek();
        expect(start.toISOString()).toBe(external_dayjs_default()().add(-1, 'week').startOf('isoWeek').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().add(-1, 'week').endOf('isoWeek').toISOString());
    });
    it('thisWeek', ()=>{
        const [start, end] = dateRanges.thisWeek();
        expect(start.toISOString()).toBe(external_dayjs_default()().startOf('isoWeek').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().endOf('isoWeek').toISOString());
    });
    it('nextWeek', ()=>{
        const [start, end] = dateRanges.nextWeek();
        expect(start.toISOString()).toBe(external_dayjs_default()().add(1, 'week').startOf('isoWeek').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().add(1, 'week').endOf('isoWeek').toISOString());
    });
    it('lastMonth', ()=>{
        const [start, end] = dateRanges.lastMonth();
        expect(start.toISOString()).toBe(external_dayjs_default()().add(-1, 'month').startOf('month').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().add(-1, 'month').endOf('month').toISOString());
    });
    it('thisMonth', ()=>{
        const [start, end] = dateRanges.thisMonth();
        expect(start.toISOString()).toBe(external_dayjs_default()().startOf('month').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().endOf('month').toISOString());
    });
    it('nextMonth', ()=>{
        const [start, end] = dateRanges.nextMonth();
        expect(start.toISOString()).toBe(external_dayjs_default()().add(1, 'month').startOf('month').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().add(1, 'month').endOf('month').toISOString());
    });
    it('lastQuarter', ()=>{
        const [start, end] = dateRanges.lastQuarter();
        expect(start.toISOString()).toBe(external_dayjs_default()().add(-1, 'quarter').startOf('quarter').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().add(-1, 'quarter').endOf('quarter').toISOString());
    });
    it('thisQuarter', ()=>{
        const [start, end] = dateRanges.thisQuarter();
        expect(start.toISOString()).toBe(external_dayjs_default()().startOf('quarter').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().endOf('quarter').toISOString());
    });
    it('nextQuarter', ()=>{
        const [start, end] = dateRanges.nextQuarter();
        expect(start.toISOString()).toBe(external_dayjs_default()().add(1, 'quarter').startOf('quarter').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().add(1, 'quarter').endOf('quarter').toISOString());
    });
    it('lastYear', ()=>{
        const [start, end] = dateRanges.lastYear();
        expect(start.toISOString()).toBe(external_dayjs_default()().add(-1, 'year').startOf('year').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().add(-1, 'year').endOf('year').toISOString());
    });
    it('thisYear', ()=>{
        const [start, end] = dateRanges.thisYear();
        expect(start.toISOString()).toBe(external_dayjs_default()().startOf('year').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().endOf('year').toISOString());
    });
    it('nextYear', ()=>{
        const [start, end] = dateRanges.nextYear();
        expect(start.toISOString()).toBe(external_dayjs_default()().add(1, 'year').startOf('year').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().add(1, 'year').endOf('year').toISOString());
    });
    it('last7Days', ()=>{
        const [start, end] = dateRanges.last7Days();
        expect(start.toISOString()).toBe(external_dayjs_default()().add(-6, 'days').startOf('days').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().endOf('days').toISOString());
    });
    it('next7Days', ()=>{
        const [start, end] = dateRanges.next7Days();
        expect(start.toISOString()).toBe(external_dayjs_default()().add(1, 'day').startOf('day').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().add(7, 'days').endOf('days').toISOString());
    });
    it('last30Days', ()=>{
        const [start, end] = dateRanges.last30Days();
        expect(start.toISOString()).toBe(external_dayjs_default()().add(-29, 'days').startOf('days').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().endOf('days').toISOString());
    });
    it('next30Days', ()=>{
        const [start, end] = dateRanges.next30Days();
        expect(start.toISOString()).toBe(external_dayjs_default()().add(1, 'day').startOf('day').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().add(30, 'days').endOf('days').toISOString());
    });
    it('last90Days', ()=>{
        const [start, end] = dateRanges.last90Days();
        expect(start.toISOString()).toBe(external_dayjs_default()().add(-89, 'days').startOf('days').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().endOf('days').toISOString());
    });
    it('next90Days', ()=>{
        const [start, end] = dateRanges.next90Days();
        expect(start.toISOString()).toBe(external_dayjs_default()().add(1, 'day').startOf('day').toISOString());
        expect(end.toISOString()).toBe(external_dayjs_default()().add(90, 'days').endOf('days').toISOString());
    });
});
var __webpack_export_target__ = exports;
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
    value: true
});
