import { render, screen, fireEvent, waitFor } from "@testing-library/react"; import { describe, it, expect, vi, beforeEach } from "vitest"; import "@testing-library/jest-dom"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { WebdavSyncSection } from "@/components/settings/WebdavSyncSection"; import type { WebDavSyncSettings } from "@/types"; const toastSuccessMock = vi.fn(); const toastErrorMock = vi.fn(); const toastWarningMock = vi.fn(); const toastInfoMock = vi.fn(); vi.mock("sonner", () => ({ toast: { success: (...args: unknown[]) => toastSuccessMock(...args), error: (...args: unknown[]) => toastErrorMock(...args), warning: (...args: unknown[]) => toastWarningMock(...args), info: (...args: unknown[]) => toastInfoMock(...args), }, })); vi.mock("react-i18next", () => ({ useTranslation: () => ({ t: (key: string) => key, }), })); vi.mock("@/components/ui/button", () => ({ Button: ({ children, ...props }: any) => , })); vi.mock("@/components/ui/input", () => ({ Input: (props: any) => , })); vi.mock("@/components/ui/switch", () => ({ Switch: ({ checked, onCheckedChange, ...props }: any) => (