"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mockHeapJsHttpRequest = exports.identifyUserSubscription = exports.trackEventSubscription = exports.createMockedHeapJsSdk = exports.HEAP_TEST_ENV_ID = void 0;
const tslib_1 = require("tslib");
const nock_1 = tslib_1.__importDefault(require("nock"));
exports.HEAP_TEST_ENV_ID = '1';
const createMockedHeapJsSdk = () => {
    return {
        appid: exports.HEAP_TEST_ENV_ID,
        config: {
            disableTextCapture: true,
            secureCookie: true
        },
        load: jest.fn(),
        track: jest.fn(),
        identify: jest.fn(),
        addUserProperties: jest.fn()
    };
};
exports.createMockedHeapJsSdk = createMockedHeapJsSdk;
exports.trackEventSubscription = {
    partnerAction: 'trackEvent',
    name: 'Track Event',
    enabled: true,
    subscribe: 'type = "track"',
    mapping: {
        name: {
            '@path': '$.name'
        },
        properties: {
            '@path': '$.properties'
        }
    }
};
exports.identifyUserSubscription = {
    partnerAction: 'identifyUser',
    name: 'Identify User',
    enabled: true,
    subscribe: 'type = "identify"',
    mapping: {
        anonymousId: {
            '@path': '$.anonymousId'
        },
        userId: {
            '@path': '$.userId'
        },
        traits: {
            '@path': '$.traits'
        }
    }
};
const mockHeapJsHttpRequest = () => {
    nock_1.default('https://cdn.heapanalytics.com').get(`/js/heap-${exports.HEAP_TEST_ENV_ID}.js`).reply(200, {});
};
exports.mockHeapJsHttpRequest = mockHeapJsHttpRequest;
//# sourceMappingURL=test-utilities.js.map