diff --git a/apps/web/src/test/pages/TemplateLibrary.test.tsx b/apps/web/src/test/pages/TemplateLibrary.test.tsx deleted file mode 100755 index 18a8f7fe5..000000000 --- a/apps/web/src/test/pages/TemplateLibrary.test.tsx +++ /dev/null @@ -1,142 +0,0 @@ -import React from "react" -import { describe, expect, it, vi } from "vitest" -import { render } from "@testing-library/react" -import { MemoryRouter } from "react-router-dom" - -vi.mock("@/components/layout/PageHead", () => ({ - default: ({ title }: { title: string }) =>
{title}
, -})) - -vi.mock("@tanstack/react-query", () => ({ - useQuery: () => ({ data: [], isLoading: false, isError: false, refetch: vi.fn() }), - useMutation: () => ({ mutate: vi.fn(), mutateAsync: vi.fn(), isLoading: false }), - useQueryClient: () => ({ invalidateQueries: vi.fn(), setQueryData: vi.fn() }), - useInfiniteQuery: () => ({ - data: { pages: [] }, - isLoading: false, - fetchNextPage: vi.fn(), - hasNextPage: false, - }), -})) - -vi.mock("@/components/ui", () => ({ - Button: ({ children, onClick }: any) => , - Input: ({ placeholder }: any) => , - Select: ({ options }: any) => ( - - ), - Modal: ({ open, children }: any) => (open ?
{children}
: null), - Empty: () =>
Empty
, - Card: ({ children }: any) =>
{children}
, - Tag: ({ children }: any) => {children}, - Tooltip: ({ children }: any) => {children}, - Upload: ({ children }: any) =>
{children}
, - Progress: () =>
, -})) - -vi.mock("antd", () => ({ - Table: () =>
, - Pagination: () =>
, - Tabs: () =>
, - Modal: ({ open, children }: any) => (open ?
{children}
: null), - message: { success: vi.fn(), error: vi.fn(), warning: vi.fn(), info: vi.fn() }, - Popconfirm: ({ children }: any) => {children}, - Form: ({ children }: any) =>
{children}
, - Input: ({ placeholder }: any) => , - InputNumber: () => , - Select: () => , - Radio: ({ children }: any) => {children}, - RadioGroup: ({ children }: any) =>
{children}
, - Checkbox: ({ children }: any) => ( - - ), - DatePicker: () => , - Col: ({ children }: any) =>
{children}
, - Row: ({ children }: any) =>
{children}
, - Card: ({ children }: any) =>
{children}
, - List: () =>
    , - Grid: { useBreakpoint: () => ({ xs: true, sm: true, md: true, lg: true }) }, - Descriptions: ({ children }: any) =>
    {children}
    , - Divider: () =>
    , - Avatar: () => , - Dropdown: ({ children }: any) => {children}, - Menu: ({ children }: any) =>
      {children}
    , - Drawer: ({ open, children }: any) => (open ?
    {children}
    : null), - Typography: { - Title: ({ children }: any) =>

    {children}

    , - Text: ({ children }: any) => {children}, - Paragraph: ({ children }: any) =>

    {children}

    , - }, - Spin: ({ spinning }: any) => (spinning ?
    Loading...
    : <>), - Slider: () => , - Rate: () =>
    , - Collapse: ({ children }: any) =>
    {children}
    , - Steps: ({ children }: any) =>
    {children}
    , - Button: ({ children }: any) => , -})) - -vi.mock("@ant-design/icons", () => ({ - CopyOutlined: () => , - ExclamationCircleOutlined: () => , - InboxOutlined: () => , - LoadingOutlined: () => , - SearchOutlined: () => , - ThunderboltOutlined: () => , -})) - -vi.mock("@/store/authStore", () => ({ - useAuthStore: (sel: any) => sel({ user: { id: "1", vip_level: 0 }, isAuthenticated: true }), -})) - -vi.mock("@/api/templates", () => ({ - getTemplates: vi.fn().mockResolvedValue({ items: [], total: 0, success: true }), - getTemplatesList: vi.fn().mockResolvedValue({ items: [], total: 0, success: true }), - getTemplate: vi.fn().mockResolvedValue({ items: [], total: 0, success: true }), - toggleFavoriteTemplate: vi.fn().mockResolvedValue({ items: [], total: 0, success: true }), - copyTemplate: vi.fn().mockResolvedValue({ items: [], total: 0, success: true }), -})) - -vi.mock("@/pages/templates/TemplateLibrary.css", () => ({})) - -import TemplateLibrary from "@/pages/templates/TemplateLibrary" -import "@/pages/templates/types/templateLibrary" -import "@/pages/templates/constants/templateLibrary" -import "@/pages/templates/utils/templateLibrary" -import "@/pages/templates/hooks/useTemplateLibrary" -import "@/pages/templates/hooks/useTemplateDetail" -import "@/pages/templates/components/template-library/TemplateCard" -import "@/pages/templates/components/template-library/TemplateDetailModal" -import "@/pages/templates/components/template-library/template-detail-modal/PreviewArea" -import "@/pages/templates/components/template-library/template-detail-modal/SegmentList" -import "@/pages/templates/components/template-library/template-detail-modal/StyleConfig" -import "@/pages/templates/components/template-library/template-detail-modal/DetailFooter" -import "@/pages/templates/components/template-library/template-detail-modal/types" -import "@/pages/templates/components/template-library/TemplateHeader" -import "@/pages/templates/components/template-library/TemplateToolbar" -import "@/pages/templates/components/template-library/TemplateGrid" - -describe("TemplateLibrary Page", () => { - it("should render without crashing", () => { - const { container } = render( - - - , - ) - expect(container.firstChild).toBeTruthy() - }) -})