"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const anonymousUsers_1 = require("./anonymousUsers");
const millisecondsInAMonth = 30 * 24 * 60 * 60 * 1000;
describe("anonymousUsers", () => {
    test("generateAnonymousId should returns an id", () => {
        expect((0, anonymousUsers_1.generateAnonymousId)()).toMatch(/anonymous_id_\d+/);
    });
    test("getOldCampaignIds should return old ids", () => {
        const campaigns = {
            "1": Date.now() - 2 * millisecondsInAMonth,
            "2": Date.now() - 4 * millisecondsInAMonth,
        };
        expect((0, anonymousUsers_1.getOldCampaignIds)(campaigns)).toEqual(["2"]);
    });
    test("getOldCampaignIds should return empty array", () => {
        const campaigns = {
            "1": Date.now() - 2 * millisecondsInAMonth,
            "2": Date.now() - 1 * millisecondsInAMonth,
        };
        expect((0, anonymousUsers_1.getOldCampaignIds)(campaigns)).toEqual([]);
    });
    test("getOldCampaignIds should not return an id", () => {
        const campaigns = {
            "1": Date.now(),
            "2": Date.now(),
        };
        expect((0, anonymousUsers_1.getOldCampaignIds)(campaigns)).toEqual([]);
    });
});
//# sourceMappingURL=anonymousUsers.test.js.map