import * as __WEBPACK_EXTERNAL_MODULE__testing_library_react__ from "@testing-library/react";
import * as __WEBPACK_EXTERNAL_MODULE__Nav_mjs__ from "./Nav.mjs";
import * as __WEBPACK_EXTERNAL_MODULE_react_router_dom__ from "react-router-dom";
describe('Nav', ()=>{
    test('should render if items are present', ()=>{
        (0, __WEBPACK_EXTERNAL_MODULE__testing_library_react__.render)(/*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE_react_router_dom__.BrowserRouter, null, /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__Nav_mjs__["default"], {
            items: [
                {
                    title: 'Link 1',
                    to: '/1',
                    icon: null
                },
                {
                    title: 'Link 2',
                    to: '/2',
                    icon: null
                }
            ]
        })));
        const nav = __WEBPACK_EXTERNAL_MODULE__testing_library_react__.screen.queryByRole('navigation');
        const link1 = __WEBPACK_EXTERNAL_MODULE__testing_library_react__.screen.queryByText('Link 1');
        const link2 = __WEBPACK_EXTERNAL_MODULE__testing_library_react__.screen.queryByText('Link 2');
        expect(nav).toBeInTheDocument();
        expect(link1).toBeInTheDocument();
        expect(link2).toBeInTheDocument();
    });
    test('should not render if no items are present', ()=>{
        (0, __WEBPACK_EXTERNAL_MODULE__testing_library_react__.render)(/*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE_react_router_dom__.BrowserRouter, null, /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__Nav_mjs__["default"], {
            items: []
        })));
        const nav = __WEBPACK_EXTERNAL_MODULE__testing_library_react__.screen.queryByRole('navigation');
        const link = __WEBPACK_EXTERNAL_MODULE__testing_library_react__.screen.queryByText('Link 1');
        expect(nav).not.toBeInTheDocument();
        expect(link).not.toBeInTheDocument();
    });
    test('should render children if the status is success', ()=>{
        const { container } = (0, __WEBPACK_EXTERNAL_MODULE__testing_library_react__.render)(/*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE_react_router_dom__.BrowserRouter, null, /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__Nav_mjs__["default"], {
            status: "success",
            items: [
                {
                    title: 'Link 1',
                    to: '/1',
                    icon: null
                }
            ]
        })));
        const skeletonElements = container.getElementsByClassName('chakra-skeleton');
        const link = __WEBPACK_EXTERNAL_MODULE__testing_library_react__.screen.queryByText('Link 1');
        expect(link).toBeInTheDocument();
        expect(skeletonElements).toHaveLength(0);
    });
    test('should not render children if the status is loading', ()=>{
        const { container } = (0, __WEBPACK_EXTERNAL_MODULE__testing_library_react__.render)(/*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE_react_router_dom__.BrowserRouter, null, /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__Nav_mjs__["default"], {
            status: "loading",
            items: [
                {
                    title: 'Link 1',
                    to: '/1',
                    icon: null
                }
            ]
        })));
        const skeletonElements = container.getElementsByClassName('chakra-skeleton');
        const link = __WEBPACK_EXTERNAL_MODULE__testing_library_react__.screen.queryByText('Link 1');
        expect(link).not.toBeInTheDocument();
        expect(skeletonElements).toHaveLength(1);
    });
});
