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 { screen, render } from '@testing-library/react';
import { MdmModuleProvider } from '../../../contexts/MdmModuleContext';
import { DummyCrosswalkRow } from './DummyCrosswalkRow';
var metadata = { sources: [{ uri: 'configuration/source/FB', label: 'Facebook' }] };
var defaultProps = { crosswalkType: 'configuration/source/FB' };
var setUp = function (props) {
    if (props === void 0) { props = defaultProps; }
    var Providers = function (_a) {
        var children = _a.children;
        return (React.createElement(MdmModuleProvider, { values: { metadata: metadata } }, children));
    };
    return render(React.createElement(DummyCrosswalkRow, __assign({}, props)), { wrapper: Providers });
};
describe('DummyCrosswalkRow tests', function () {
    it('should render dummy crosswalk correctly', function () {
        setUp();
        var button = screen.getByRole('button');
        expect(button).toBeDisabled();
        expect(button).not.toBeEmptyDOMElement();
        screen.getByText('Facebook');
        screen.getByText('F');
    });
    it('should not show eye icon if focused === false', function () {
        setUp(__assign(__assign({}, defaultProps), { focusable: false }));
        var button = screen.getByRole('button');
        expect(button).toBeDisabled();
        expect(button).toBeEmptyDOMElement();
    });
});
