import React from 'react';
import { render, screen } from '@testing-library/react';
import { ArrowLeft, ArrowRight } from '@zarm-design/icons';
import NavBar from '../index';
import ConfigProvider from '../../config-provider';
describe('NavBar', function () {
  it('should renders correctly', function () {
    var _render = render( /*#__PURE__*/React.createElement(NavBar, null)),
        asFragment = _render.asFragment;

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

    expect(asFragment().firstChild).toMatchSnapshot();
  });
  it('renders correctly with left content', function () {
    var _render3 = render( /*#__PURE__*/React.createElement(NavBar, {
      left: /*#__PURE__*/React.createElement(ArrowLeft, null)
    })),
        asFragment = _render3.asFragment;

    expect(asFragment().firstChild).toMatchSnapshot();
  });
  it('renders correctly with right content', function () {
    var _render4 = render( /*#__PURE__*/React.createElement(NavBar, {
      right: /*#__PURE__*/React.createElement(ArrowRight, null)
    })),
        asFragment = _render4.asFragment;

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

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