import React from 'react'; import { describe, expect, it, vi } from 'vitest'; import { render, screen } from '@testing-library/react'; const articles = [ { slug: 'faq-admin', title: 'FAQ: Event Admin', summary: 'Common issues.' }, { slug: 'tenant-dashboard-overview', title: 'Dashboard overview', summary: 'Learn the dashboard.' }, ]; vi.mock('@tanstack/react-query', () => ({ useQuery: () => ({ data: articles, isLoading: false, isError: false, refetch: vi.fn(), }), })); vi.mock('react-router-dom', () => ({ useNavigate: () => vi.fn(), })); vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (_key: string, fallback?: string) => fallback ?? _key, i18n: { language: 'de' }, }), initReactI18next: { type: '3rdParty', init: () => undefined, }, })); vi.mock('../components/MobileShell', () => ({ MobileShell: ({ children }: { children: React.ReactNode }) =>
{children}
, })); vi.mock('../hooks/useBackNavigation', () => ({ useBackNavigation: () => vi.fn(), })); vi.mock('../theme', () => ({ useAdminTheme: () => ({ textStrong: '#111827', muted: '#6b7280', border: '#e5e7eb', surfaceMuted: '#f3f4f6', shadow: 'rgba(0,0,0,0.12)', }), })); vi.mock('@tamagui/stacks', () => ({ YStack: ({ children }: { children: React.ReactNode }) =>
{children}
, XStack: ({ children }: { children: React.ReactNode }) =>
{children}
, })); vi.mock('@tamagui/text', () => ({ SizableText: ({ children }: { children: React.ReactNode }) => {children}, })); vi.mock('@tamagui/group', () => ({ YGroup: Object.assign(({ children }: { children: React.ReactNode }) =>
{children}
, { Item: ({ children }: { children: React.ReactNode }) =>
{children}
, }), })); vi.mock('@tamagui/list-item', () => ({ ListItem: ({ title, subTitle }: { title?: React.ReactNode; subTitle?: React.ReactNode }) => (
{title} {subTitle}
), })); vi.mock('tamagui', () => ({ Separator: ({ children }: { children?: React.ReactNode }) =>
{children}
, })); vi.mock('../components/Primitives', () => ({ MobileCard: ({ children }: { children: React.ReactNode }) =>
{children}
, CTAButton: ({ label }: { label: string }) => , SkeletonCard: () =>
Loading...
, })); import MobileHelpCenterPage from '../HelpCenterPage'; describe('MobileHelpCenterPage', () => { it('renders FAQ and guide articles', async () => { render(); expect(screen.getByText('FAQ: Event Admin')).toBeInTheDocument(); expect(screen.getByText('Dashboard overview')).toBeInTheDocument(); }); });