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);
};
import React from 'react';
import { render, screen } from '@testing-library/react';
import { MdmModuleProvider } from '../../../../../contexts/MdmModuleContext';
import { ActivityTypes } from '../../../types';
import { CollapsibleItemsProvider } from '../../../contexts/CollapsibleItemsContext';
import { PotentialMatchActivity } from './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: 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: 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: 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.createElement(MdmModuleProvider, { values: mdmValues },
            React.createElement(CollapsibleItemsProvider, null, children)));
    };
    return render(React.createElement(PotentialMatchActivity, __assign({}, props)), { wrapper: Providers });
};
describe('Potential match activity tests', function () {
    it('should render correctly', function () {
        setUp();
        screen.getByText('Profile un-merged');
        var records = 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');
    });
});
