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 { BasicViewHeader } from './BasicViewHeader';
describe('BasicViewHeader tests', function () {
    var defaultProps = {
        children: React.createElement("div", { "data-reltio-id": "children" }),
        title: 'Title',
        classes: { root: 'root', title: 'title' }
    };
    var setUp = function (_a) {
        var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? {} : _c;
        return render(React.createElement(BasicViewHeader, __assign({}, defaultProps, props)));
    };
    it('should render styled toolbar with title and children', function () {
        var container = setUp().container;
        var toolbar = container.querySelector('.toolbar');
        var title = screen.getByText(defaultProps.title);
        expect(toolbar).toBeInTheDocument();
        expect(toolbar).toHaveClass(defaultProps.classes.root);
        expect(title).toBeInTheDocument();
        expect(title).toHaveClass(defaultProps.classes.title);
        expect(screen.getByTestId('children')).toBeInTheDocument();
    });
    it('should render toolbar without title', function () {
        var container = setUp({ props: { title: '' } }).container;
        var title = container.querySelector('.title');
        expect(title).not.toBeInTheDocument();
        expect(screen.getByTestId('children')).toBeInTheDocument();
    });
});
