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 { DataTypes } from '@reltio/mdm-sdk';
import { mockBasicTableSizing } from '../test-utils';
import { TableSkeleton } from './TableSkeleton';
describe('TableSkeleton tests', function () {
    var tableColumnsData = [
        {
            id: 'entity.label',
            label: 'Entity label',
            dataTypeDefinition: { type: DataTypes.TYPE_STRING }
        },
        {
            id: 'relation.label',
            label: 'Directional label',
            dataTypeDefinition: { type: DataTypes.TYPE_STRING }
        }
    ];
    var setUp = function (props) {
        if (props === void 0) { props = {}; }
        return render(React.createElement(TableSkeleton, __assign({ tableColumnsData: tableColumnsData }, props)));
    };
    it('should render table skeleton correctly', function () {
        setUp();
        tableColumnsData.forEach(function (column) {
            expect(screen.getByText(column.label)).toBeInTheDocument();
        });
    });
    it('should use passed custom rowRenderer', function () {
        var TestRowCellRenderer = function (props) {
            return React.createElement("div", { "data-reltio-id": "cell" }, "Cell-".concat(props.columnIndex));
        };
        var unmockTableSizing = mockBasicTableSizing();
        setUp({ RowCellRenderer: TestRowCellRenderer });
        var cells = screen.getAllByTestId('cell');
        expect(cells).toHaveLength(tableColumnsData.length);
        cells.forEach(function (cell, index) {
            expect(cell).toHaveTextContent("Cell-".concat(index));
        });
        unmockTableSizing();
    });
    it('should use other passed props', function () {
        var container = setUp({ containerClassName: 'testClassname' }).container;
        expect(container.firstChild).toHaveClass('testClassname');
    });
});
