"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _react = _interopRequireDefault(require("react"));

var _react2 = require("@testing-library/react");

var _icons = require("@zarm-design/icons");

var _index = _interopRequireDefault(require("../index"));

var _configProvider = _interopRequireDefault(require("../../config-provider"));

describe('NavBar', function () {
  it('should renders correctly', function () {
    var _render = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, null)),
        asFragment = _render.asFragment;

    expect(asFragment().firstChild).toMatchSnapshot();
  });
  it('should renders correctly with title', function () {
    var _render2 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
      title: "\u8FD9\u662F\u6807\u9898"
    })),
        asFragment = _render2.asFragment;

    expect(asFragment().firstChild).toMatchSnapshot();
  });
  it('renders correctly with left content', function () {
    var _render3 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
      left: /*#__PURE__*/_react.default.createElement(_icons.ArrowLeft, null)
    })),
        asFragment = _render3.asFragment;

    expect(asFragment().firstChild).toMatchSnapshot();
  });
  it('renders correctly with right content', function () {
    var _render4 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
      right: /*#__PURE__*/_react.default.createElement(_icons.ArrowRight, null)
    })),
        asFragment = _render4.asFragment;

    expect(asFragment().firstChild).toMatchSnapshot();
  });
  it('should render with custom prefix className ', function () {
    (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_configProvider.default, {
      prefixCls: "custom"
    }, /*#__PURE__*/_react.default.createElement(_index.default, {
      "data-testid": "navbar"
    })));
    expect(_react2.screen.queryByTestId('navbar')).toHaveClass('custom-nav-bar');
  });
  test('should add HTML attributes to root element', function () {
    var _render5 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
      id: "a"
    })),
        asFragment = _render5.asFragment;

    expect(asFragment().firstChild).toHaveAttribute('id', 'a');
  });
});