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, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { DndContext } from '@dnd-kit/core';
import { attributes, attributeTypes } from './attributes.test-data';
import { InlineAttributesList } from './InlineAttributesList';
describe('InlineAttributesList tests', function () {
    var parentUri = 'entities/xT3HJZ7';
    var defaultProps = {
        attributeTypes: attributeTypes,
        attributes: attributes,
        parentUri: parentUri,
        crosswalksMap: {},
        onPin: jest.fn(),
        onIgnore: jest.fn(),
        onEdit: jest.fn(),
        onDelete: jest.fn(),
        onAdd: jest.fn(),
        emptyTempAttributeUris: []
    };
    var setUp = function (props) {
        if (props === void 0) { props = {}; }
        var user = userEvent.setup();
        var Providers = function (_a) {
            var children = _a.children;
            return React.createElement(DndContext, null, children);
        };
        return __assign({ user: user }, render(React.createElement(InlineAttributesList, __assign({}, defaultProps, props)), { wrapper: Providers }));
    };
    it('should render list of readable attributes', function () {
        setUp();
        var pagers = screen.getAllByTestId('branch-decorator');
        expect(pagers.length).toBe(3);
        var labels = ['Role', 'Name', 'Required'];
        pagers.forEach(function (pager, i) {
            expect(within(pager).getByText(labels[i])).toBeInTheDocument();
            expect(within(pager).getByTestId('simple-attributes-wrapper')).toBeInTheDocument();
        });
    });
});
