"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importDefault(require("react"));
var react_2 = require("@testing-library/react");
var MdmModuleContext_1 = require("../../../../../contexts/MdmModuleContext");
var types_1 = require("../../../types");
var CollapsibleItemsContext_1 = require("../../../contexts/CollapsibleItemsContext");
var PotentialMatchActivity_1 = require("./PotentialMatchActivity");
var defaultData = {
    uri: 'activities/156a1eda-4c2c-46e3-8550-118c500fb453',
    user: 'marat.ahmetzyanov',
    timestamp: 1620711408828,
    items: [
        {
            id: '5C94p4Yp',
            objectUri: 'entities/1PN94HrW',
            objectLabel: 'item 1 label',
            timestamp: 1620711408828,
            data: {
                type: types_1.ActivityTypes.ENTITIES_SPLITTED,
                newUri: 'entities/sOoSQYm',
                'entities/sOoSQYm': 'item 1 entity label 1'
            }
        },
        {
            id: '72Jsk10Kl',
            objectUri: 'entities/KsJmn28A',
            objectLabel: 'item 2 label',
            timestamp: 1620711404672,
            data: {
                type: types_1.ActivityTypes.POTENTIAL_MATCHES_FOUND,
                potentialMatches: 'entities/sOoSQYm,entities/o92Bsm1',
                'entities/sOoSQYm': 'item 2 entity label 1',
                'entities/o92Bsm1': 'item 2 entity label 2'
            }
        }
    ],
    itemsTotal: 2
};
var defaultProps = {
    data: defaultData,
    type: types_1.ActivityTypes.ENTITIES_SPLITTED
};
var defaultMdmValues = {
    uiPath: 'https://reltio.com/nui'
};
var setUp = function (_a) {
    var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d;
    var Providers = function (_a) {
        var children = _a.children;
        return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues },
            react_1.default.createElement(CollapsibleItemsContext_1.CollapsibleItemsProvider, null, children)));
    };
    return (0, react_2.render)(react_1.default.createElement(PotentialMatchActivity_1.PotentialMatchActivity, __assign({}, props)), { wrapper: Providers });
};
describe('Potential match activity tests', function () {
    it('should render correctly', function () {
        setUp();
        react_2.screen.getByText('Profile un-merged');
        var records = react_2.screen.getAllByTestId('reltio-activity-log-record');
        expect(records).toHaveLength(2);
        expect(records[0]).toHaveTextContent('item 1 label');
        expect(records[0]).toHaveTextContent('Un-merged with:item 1 entity label 1');
        expect(records[1]).toHaveTextContent('item 2 label');
        expect(records[1]).toHaveTextContent('Matches found:item 2 entity label 1, item 2 entity label 2');
    });
});
