import React from 'react';
import { describe, expect, it, vi } from 'vitest';
import { render, screen } from '@testing-library/react';
const article = {
slug: 'tenant-dashboard-overview',
title: 'Dashboard overview',
summary: 'Learn the dashboard.',
body_html: '
Welcome
',
related: [],
};
vi.mock('@tanstack/react-query', () => ({
useQuery: () => ({
data: article,
isLoading: false,
isError: false,
refetch: vi.fn(),
}),
}));
vi.mock('react-router-dom', () => ({
useParams: () => ({ slug: 'tenant-dashboard-overview' }),
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',
}),
}));
vi.mock('@tamagui/stacks', () => ({
YStack: ({ 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 }: { title?: React.ReactNode }) => {title}
,
}));
vi.mock('../components/Primitives', () => ({
MobileCard: ({ children }: { children: React.ReactNode }) => {children}
,
CTAButton: ({ label }: { label: string }) => ,
SkeletonCard: () => Loading...
,
}));
import MobileHelpArticlePage from '../HelpArticlePage';
describe('MobileHelpArticlePage', () => {
it('renders article title', async () => {
render();
expect(screen.getByText('Dashboard overview')).toBeInTheDocument();
});
});