"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const field_1 = require("../types/field");
const timeFrames_1 = require("../types/timeFrames");
const pivotQueryResults_1 = require("./pivotQueryResults");
describe('timeIntervalToExcelNumFmt', () => {
    it('YEAR → yyyy', () => {
        expect((0, pivotQueryResults_1.timeIntervalToExcelNumFmt)(timeFrames_1.TimeFrames.YEAR, field_1.DimensionType.DATE)).toBe('yyyy');
    });
    it('MONTH → yyyy-mm', () => {
        expect((0, pivotQueryResults_1.timeIntervalToExcelNumFmt)(timeFrames_1.TimeFrames.MONTH, field_1.DimensionType.DATE)).toBe('yyyy-mm');
    });
    it('DAY → yyyy-mm-dd', () => {
        expect((0, pivotQueryResults_1.timeIntervalToExcelNumFmt)(timeFrames_1.TimeFrames.DAY, field_1.DimensionType.DATE)).toBe('yyyy-mm-dd');
    });
    it('HOUR → yyyy-mm-dd hh:00', () => {
        expect((0, pivotQueryResults_1.timeIntervalToExcelNumFmt)(timeFrames_1.TimeFrames.HOUR, field_1.DimensionType.TIMESTAMP)).toBe('yyyy-mm-dd hh:00');
    });
    it('MINUTE → yyyy-mm-dd hh:mm', () => {
        expect((0, pivotQueryResults_1.timeIntervalToExcelNumFmt)(timeFrames_1.TimeFrames.MINUTE, field_1.DimensionType.TIMESTAMP)).toBe('yyyy-mm-dd hh:mm');
    });
    it('SECOND → yyyy-mm-dd hh:mm:ss', () => {
        expect((0, pivotQueryResults_1.timeIntervalToExcelNumFmt)(timeFrames_1.TimeFrames.SECOND, field_1.DimensionType.TIMESTAMP)).toBe('yyyy-mm-dd hh:mm:ss');
    });
    it('MILLISECOND → yyyy-mm-dd hh:mm:ss.000', () => {
        expect((0, pivotQueryResults_1.timeIntervalToExcelNumFmt)(timeFrames_1.TimeFrames.MILLISECOND, field_1.DimensionType.TIMESTAMP)).toBe('yyyy-mm-dd hh:mm:ss.000');
    });
    it('RAW + DATE → yyyy-mm-dd', () => {
        expect((0, pivotQueryResults_1.timeIntervalToExcelNumFmt)(timeFrames_1.TimeFrames.RAW, field_1.DimensionType.DATE)).toBe('yyyy-mm-dd');
    });
    it('RAW + TIMESTAMP → yyyy-mm-dd hh:mm:ss', () => {
        expect((0, pivotQueryResults_1.timeIntervalToExcelNumFmt)(timeFrames_1.TimeFrames.RAW, field_1.DimensionType.TIMESTAMP)).toBe('yyyy-mm-dd hh:mm:ss');
    });
    it('undefined + DATE → yyyy-mm-dd', () => {
        expect((0, pivotQueryResults_1.timeIntervalToExcelNumFmt)(undefined, field_1.DimensionType.DATE)).toBe('yyyy-mm-dd');
    });
    it('undefined + TIMESTAMP → yyyy-mm-dd hh:mm:ss', () => {
        expect((0, pivotQueryResults_1.timeIntervalToExcelNumFmt)(undefined, field_1.DimensionType.TIMESTAMP)).toBe('yyyy-mm-dd hh:mm:ss');
    });
    it('WEEK → null (non-native)', () => {
        expect((0, pivotQueryResults_1.timeIntervalToExcelNumFmt)(timeFrames_1.TimeFrames.WEEK, field_1.DimensionType.DATE)).toBeNull();
    });
    it('QUARTER → null (non-native)', () => {
        expect((0, pivotQueryResults_1.timeIntervalToExcelNumFmt)(timeFrames_1.TimeFrames.QUARTER, field_1.DimensionType.DATE)).toBeNull();
    });
    it('DAY_OF_WEEK_NAME → null (non-native)', () => {
        expect((0, pivotQueryResults_1.timeIntervalToExcelNumFmt)(timeFrames_1.TimeFrames.DAY_OF_WEEK_NAME, field_1.DimensionType.DATE)).toBeNull();
    });
    it('MONTH_NAME → null (non-native)', () => {
        expect((0, pivotQueryResults_1.timeIntervalToExcelNumFmt)(timeFrames_1.TimeFrames.MONTH_NAME, field_1.DimensionType.DATE)).toBeNull();
    });
    it('QUARTER_NUM → null (non-native)', () => {
        expect((0, pivotQueryResults_1.timeIntervalToExcelNumFmt)(timeFrames_1.TimeFrames.QUARTER_NUM, field_1.DimensionType.DATE)).toBeNull();
    });
});
//# sourceMappingURL=timeIntervalToExcelNumFmt.test.js.map