"use strict";
// The require scope
var __webpack_require__ = {};
/************************************************************************/ // webpack/runtime/compat_get_default_export
(()=>{
    // getDefaultExport function for compatibility with non-ESM modules
    __webpack_require__.n = function(module) {
        var getter = module && module.__esModule ? function() {
            return module['default'];
        } : function() {
            return module;
        };
        __webpack_require__.d(getter, {
            a: getter
        });
        return getter;
    };
})();
// webpack/runtime/define_property_getters
(()=>{
    __webpack_require__.d = function(exports1, definition) {
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
// webpack/runtime/has_own_property
(()=>{
    __webpack_require__.o = function(obj, prop) {
        return Object.prototype.hasOwnProperty.call(obj, prop);
    };
})();
/************************************************************************/ var __webpack_exports__ = {};
const react_namespaceObject = require("@testing-library/react");
const external_Nav_js_namespaceObject = require("./Nav.js");
var external_Nav_js_default = /*#__PURE__*/ __webpack_require__.n(external_Nav_js_namespaceObject);
const external_react_router_dom_namespaceObject = require("react-router-dom");
describe('Nav', ()=>{
    test('should render if items are present', ()=>{
        (0, react_namespaceObject.render)(/*#__PURE__*/ React.createElement(external_react_router_dom_namespaceObject.BrowserRouter, null, /*#__PURE__*/ React.createElement(external_Nav_js_default(), {
            items: [
                {
                    title: 'Link 1',
                    to: '/1',
                    icon: null
                },
                {
                    title: 'Link 2',
                    to: '/2',
                    icon: null
                }
            ]
        })));
        const nav = react_namespaceObject.screen.queryByRole('navigation');
        const link1 = react_namespaceObject.screen.queryByText('Link 1');
        const link2 = react_namespaceObject.screen.queryByText('Link 2');
        expect(nav).toBeInTheDocument();
        expect(link1).toBeInTheDocument();
        expect(link2).toBeInTheDocument();
    });
    test('should not render if no items are present', ()=>{
        (0, react_namespaceObject.render)(/*#__PURE__*/ React.createElement(external_react_router_dom_namespaceObject.BrowserRouter, null, /*#__PURE__*/ React.createElement(external_Nav_js_default(), {
            items: []
        })));
        const nav = react_namespaceObject.screen.queryByRole('navigation');
        const link = react_namespaceObject.screen.queryByText('Link 1');
        expect(nav).not.toBeInTheDocument();
        expect(link).not.toBeInTheDocument();
    });
    test('should render children if the status is success', ()=>{
        const { container } = (0, react_namespaceObject.render)(/*#__PURE__*/ React.createElement(external_react_router_dom_namespaceObject.BrowserRouter, null, /*#__PURE__*/ React.createElement(external_Nav_js_default(), {
            status: "success",
            items: [
                {
                    title: 'Link 1',
                    to: '/1',
                    icon: null
                }
            ]
        })));
        const skeletonElements = container.getElementsByClassName('chakra-skeleton');
        const link = react_namespaceObject.screen.queryByText('Link 1');
        expect(link).toBeInTheDocument();
        expect(skeletonElements).toHaveLength(0);
    });
    test('should not render children if the status is loading', ()=>{
        const { container } = (0, react_namespaceObject.render)(/*#__PURE__*/ React.createElement(external_react_router_dom_namespaceObject.BrowserRouter, null, /*#__PURE__*/ React.createElement(external_Nav_js_default(), {
            status: "loading",
            items: [
                {
                    title: 'Link 1',
                    to: '/1',
                    icon: null
                }
            ]
        })));
        const skeletonElements = container.getElementsByClassName('chakra-skeleton');
        const link = react_namespaceObject.screen.queryByText('Link 1');
        expect(link).not.toBeInTheDocument();
        expect(skeletonElements).toHaveLength(1);
    });
});
var __webpack_export_target__ = exports;
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
    value: true
});
