import React from 'react'; import { describe, expect, it, vi } from 'vitest'; import { render, screen, waitFor } from '@testing-library/react'; import { MemoryRouter, Route, Routes } from 'react-router-dom'; import HelpArticlePage from '../HelpArticlePage'; import type { HelpArticleDetail } from '../../services/helpApi'; vi.mock('../../i18n/LocaleContext', () => ({ useLocale: () => ({ locale: 'de' }), })); vi.mock('../../i18n/useTranslation', () => ({ useTranslation: () => ({ t: (key: string) => key, }), })); vi.mock('../../services/helpApi', () => ({ getHelpArticle: vi.fn(), })); const { getHelpArticle } = await import('../../services/helpApi'); describe('HelpArticlePage', () => { it('renders a single back button after loading', async () => { const article: HelpArticleDetail = { slug: 'gallery-and-sharing', title: 'Galerie & Teilen', summary: 'Kurzfassung', body_html: '
Inhalt
', }; (getHelpArticle as ReturnType