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 { TenantLabel } from './TenantLabel';
var defaultMdmValues = {
    tenant: { id: 'tenant', name: 'alenat' },
    environment: ''
};
var setUp = function (_a) {
    var _b = _a === void 0 ? {} : _a, _c = _b.mdmValues, mdmValues = _c === void 0 ? defaultMdmValues : _c;
    var Providers = function (_a) {
        var children = _a.children;
        return (React.createElement(MdmModuleProvider, { values: mdmValues }, children));
    };
    return render(React.createElement(TenantLabel, null), { wrapper: Providers });
};
describe('TenantLabel behaviour', function () {
    it('should render main parts', function () {
        var mdmValues = __assign(__assign({}, defaultMdmValues), { environment: 'tst-01' });
        setUp({ mdmValues: mdmValues });
        expect(screen.getByText('alenat - TST-01')).toBeInTheDocument();
        expect(screen.getByTestId('reltio-tenant-icon')).toBeInTheDocument();
    });
    it('should render correct label when environment name is empty', function () {
        setUp();
        expect(screen.getByText('alenat')).toBeInTheDocument();
    });
});
