import {render, screen, waitFor} from "@testing-library/react";
import MockAppWithProviders from "../../../../../mocks/AppWithProvider";
import RoleManagementComponent from "@/components/dashboard/role-management/RoleManagementComponent";

describe("Role Management", ()=>{
    describe("Rendering", ()=>{
        it('should see id title of data table', async () => {
            render(
                <MockAppWithProviders>
                    <RoleManagementComponent />
                </MockAppWithProviders>
            )
            const idEelement = screen.queryByText("کد یکتا")
            await waitFor(()=>{
                expect(idEelement).toBeInTheDocument()
            })
        });
        it('should see name title of data table', async () => {
            render(
                <MockAppWithProviders>
                    <RoleManagementComponent />
                </MockAppWithProviders>
            )
            const nameEelement = screen.queryByText("نام انگلیسی")
            await waitFor(()=>{
                expect(nameEelement).toBeInTheDocument()
            })
        });
        it('should see name_fa title of data table', async () => {
            render(
                <MockAppWithProviders>
                    <RoleManagementComponent />
                </MockAppWithProviders>
            )
            const name_faEelement = screen.queryByText("نام فارسی")
            await waitFor(()=>{
                expect(name_faEelement).toBeInTheDocument()
            })
        });
        it('should see created at title of data table', async () => {
            render(
                <MockAppWithProviders>
                    <RoleManagementComponent />
                </MockAppWithProviders>
            )
            const createdEelement = screen.queryByText("تاریخ درخواست")
            await waitFor(()=>{
                expect(createdEelement).toBeInTheDocument()
            })
        });
        it('should see updated at title of data table', async () => {
            render(
                <MockAppWithProviders>
                    <RoleManagementComponent />
                </MockAppWithProviders>
            )
            const updateEelement = screen.queryByText("تاریخ بروزرسانی")
            await waitFor(()=>{
                expect(updateEelement).toBeInTheDocument()
            })
        });
    })
})