import {act, render, screen, waitFor} from "@testing-library/react";
import MockAppWithProviders from "../../../../../../../mocks/AppWithProvider";
import DeleteContent from "@/components/dashboard/role-management/Form/DeleteForm/DeleteContent";
import UpdateContent from "@/components/dashboard/role-management/Form/UpdateForm/UpdateContent";

describe("Create Content component from Create Form Component in Role Management Component", () => {
    describe("Rendering", () => {
        it('should see DeleteDialog text in the top ', async () => {
            render(
                <MockAppWithProviders>
                    <DeleteContent rowId = {1}/>
                </MockAppWithProviders>
            )
            const textElement = screen.queryByText("حذف")
            await waitFor(() => {
                expect(textElement).toBeInTheDocument()
            })
        })
        it('should see DeleteDialog text content ', async () => {
            render(
                <MockAppWithProviders>
                    <DeleteContent rowId = {1}/>
                </MockAppWithProviders>
            )
            const textElement = screen.queryByText("آیا از حدف این مورد اطمینان دارید ؟")
            await waitFor(() => {
                expect(textElement).toBeInTheDocument()
            })
        })
        it('should see delete text in the delete button ', async () => {
            render(
                <MockAppWithProviders>
                    <DeleteContent rowId = {1}/>
                </MockAppWithProviders>
            )
            const buttonElement = screen.queryByText("حذف کردن")
            await waitFor(() => {
                expect(buttonElement).toBeInTheDocument()
            })
        });
        it('should see cancel text in the cancel button ', async () => {
            render(
                <MockAppWithProviders>
                    <DeleteContent rowId = {1}/>
                </MockAppWithProviders>
            )
            const buttonElement = screen.queryByText("انصراف")
            await waitFor(() => {
                expect(buttonElement).toBeInTheDocument()
            })
        });
    })
})