"use strict";
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);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importDefault(require("react"));
var react_2 = require("@testing-library/react");
var user_event_1 = __importDefault(require("@testing-library/user-event"));
var core_1 = require("@dnd-kit/core");
var attributes_test_data_1 = require("./attributes.test-data");
var InlineAttributesList_1 = require("./InlineAttributesList");
describe('InlineAttributesList tests', function () {
    var parentUri = 'entities/xT3HJZ7';
    var defaultProps = {
        attributeTypes: attributes_test_data_1.attributeTypes,
        attributes: attributes_test_data_1.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 = user_event_1.default.setup();
        var Providers = function (_a) {
            var children = _a.children;
            return react_1.default.createElement(core_1.DndContext, null, children);
        };
        return __assign({ user: user }, (0, react_2.render)(react_1.default.createElement(InlineAttributesList_1.InlineAttributesList, __assign({}, defaultProps, props)), { wrapper: Providers }));
    };
    it('should render list of readable attributes', function () {
        setUp();
        var pagers = react_2.screen.getAllByTestId('branch-decorator');
        expect(pagers.length).toBe(3);
        var labels = ['Role', 'Name', 'Required'];
        pagers.forEach(function (pager, i) {
            expect((0, react_2.within)(pager).getByText(labels[i])).toBeInTheDocument();
            expect((0, react_2.within)(pager).getByTestId('simple-attributes-wrapper')).toBeInTheDocument();
        });
    });
});
