import {fireEvent, render, screen, waitFor} from "@testing-library/react";
import MockAppWithProviders from "../../../../../../../mocks/AppWithProvider";
import UpdateContent from "@/components/dashboard/role-management/Form/UpdateForm/UpdateContent";
import UpdateForm from "@/components/dashboard/role-management/Form/UpdateForm";
import userEvent from "@testing-library/user-event";

describe("Create Form Component from Role Management Component",()=>{
    describe("Rendering",()=>{
        it('should see Tooltip text when mouse over',  async () => {
            render(
                <MockAppWithProviders>
                    <UpdateForm />
                </MockAppWithProviders>
            )
            const buttonElement = screen.getByTestId("dialog_tooltip");
            fireEvent.mouseOver(buttonElement);
            await waitFor(()=>{
                expect(screen.queryByText("ویرایش")).toBeVisible();
            })
        });
    })
})