"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var helpers_1 = require("./helpers");
var groupEntry = function (label) {
    var values = [];
    for (var _i = 1; _i < arguments.length; _i++) {
        values[_i - 1] = arguments[_i];
    }
    return ({ label: label, values: values, value: '' });
};
var entry = function (value) { return ({ value: value }); };
var groupOpt = function (label, depth) { return ({ label: label, depth: depth, isGroup: true }); };
var entryOpt = function (value, depth) { return ({ value: value, depth: depth }); };
describe('entries helpers', function () {
    describe('flattenGroupedEntries', function () {
        it('should return empty array for empty entries', function () {
            expect((0, helpers_1.flattenGroupedEntries)([])).toEqual([]);
        });
        it('should flatten grouped entries with depth assignment', function () {
            expect((0, helpers_1.flattenGroupedEntries)([
                groupEntry('L1 1', groupEntry('L2 1', entry('L3 1'), entry('L3 2')), entry('L2 2')),
                groupEntry('L1 2', entry('L2 3')),
                entry('L1 3')
            ])).toEqual([
                groupOpt('L1 1', 0),
                groupOpt('L2 1', 1),
                entryOpt('L3 1', 2),
                entryOpt('L3 2', 2),
                entryOpt('L2 2', 1),
                groupOpt('L1 2', 0),
                entryOpt('L2 3', 1),
                entryOpt('L1 3', 0)
            ]);
        });
    });
});
