import { cleanup, render, screen } from "@testing-library/react"; import { afterEach, describe, expect, test, vi } from "vitest"; import { GeneralSettingsLoading } from "./loading"; vi.mock("@/modules/projects/settings/components/project-config-navigation", () => ({ ProjectConfigNavigation: (props: any) =>
, })); vi.mock("@/modules/ui/components/page-content-wrapper", () => ({ PageContentWrapper: ({ children }: any) =>
{children}
, })); vi.mock("@/modules/ui/components/page-header", () => ({ PageHeader: ({ children, pageTitle }: any) => (
{pageTitle}
{children}
), })); vi.mock("@/app/(app)/components/LoadingCard", () => ({ LoadingCard: (props: any) => (

{props.title}

{props.description}

), })); describe("GeneralSettingsLoading", () => { afterEach(() => { cleanup(); }); test("renders all tolgee strings and main UI elements", () => { render(); expect(screen.getByTestId("page-content-wrapper")).toBeInTheDocument(); expect(screen.getByTestId("page-header")).toBeInTheDocument(); expect(screen.getByTestId("project-config-navigation")).toBeInTheDocument(); expect(screen.getAllByTestId("loading-card").length).toBe(3); expect(screen.getByText("common.project_configuration")).toBeInTheDocument(); expect(screen.getByText("common.project_name")).toBeInTheDocument(); expect( screen.getByText("environments.project.general.project_name_settings_description") ).toBeInTheDocument(); expect(screen.getByText("environments.project.general.recontact_waiting_time")).toBeInTheDocument(); expect( screen.getByText("environments.project.general.recontact_waiting_time_settings_description") ).toBeInTheDocument(); expect(screen.getByText("environments.project.general.delete_project")).toBeInTheDocument(); expect( screen.getByText("environments.project.general.delete_project_settings_description") ).toBeInTheDocument(); }); });