import {render, screen, waitFor} from "@testing-library/react";
import MockAppWithProviders from "../../../../../../mocks/AppWithProvider";
import SidebarList from "@/components/layouts/Dashboard/Sidebar/SidebarList";

describe('SidebarList', () => {
    describe('Rendering', () => {
        it('renders sidebar items based on user permissions', async () => {
            localStorage.setItem("_token", 'token');
            render(<MockAppWithProviders><SidebarList/></MockAppWithProviders>);
            await waitFor(()=>{
                const sidebarItem = screen.getByText('مدیریت نقش ها');
                expect(sidebarItem).toBeInTheDocument();
            })
        });
    })
})
