// src/tests/setup/mockUI.ts
import { vi } from 'vitest';

/**
 * This setup file centralizes the mocking of common UI components for high-level tests like App.test.tsx.
 * By importing this single file into a test, all standard UI components are replaced with their mock implementations
 * from `src/tests/utils/componentMocks.tsx`, reducing boilerplate in the test files.
 *
 * Note: Mocks that require special logic (e.g., using `vi.importActual`) should remain in the test file itself.
 */

vi.mock('../../components/Footer', async () => {
  const { MockFooter } = await import('../utils/componentMocks');
  return { Footer: MockFooter };
});

vi.mock('../../components/Header', async () => {
  const { MockHeader } = await import('../utils/componentMocks');
  return { Header: MockHeader };
});

vi.mock('../../pages/HomePage', async () => {
  const { MockHomePage } = await import('../utils/componentMocks');
  return { HomePage: MockHomePage };
});

vi.mock('../../pages/admin/AdminPage', async () => {
  const { MockAdminPage } = await import('../utils/componentMocks');
  return { AdminPage: MockAdminPage };
});

vi.mock('../../pages/admin/CorrectionsPage', async () => {
  const { MockCorrectionsPage } = await import('../utils/componentMocks');
  return { CorrectionsPage: MockCorrectionsPage };
});

vi.mock('../../pages/admin/AdminStatsPage', async () => {
  const { MockAdminStatsPage } = await import('../utils/componentMocks');
  return { AdminStatsPage: MockAdminStatsPage };
});

vi.mock('../../pages/VoiceLabPage', async () => {
  const { MockVoiceLabPage } = await import('../utils/componentMocks');
  return { VoiceLabPage: MockVoiceLabPage };
});

vi.mock('../../pages/ResetPasswordPage', async () => {
  const { MockResetPasswordPage } = await import('../utils/componentMocks');
  return { ResetPasswordPage: MockResetPasswordPage };
});

vi.mock('../../pages/admin/components/ProfileManager', async () => {
  const { MockProfileManager } = await import('../utils/componentMocks');
  return { ProfileManager: MockProfileManager };
});

vi.mock('../../features/voice-assistant/VoiceAssistant', async () => {
  const { MockVoiceAssistant } = await import('../utils/componentMocks');
  return { VoiceAssistant: MockVoiceAssistant };
});

vi.mock('../../components/FlyerCorrectionTool', async () => {
  const { MockFlyerCorrectionTool } = await import('../utils/componentMocks');
  return { FlyerCorrectionTool: MockFlyerCorrectionTool };
});

vi.mock('../../components/WhatsNewModal', async () => {
  const { MockWhatsNewModal } = await import('../utils/componentMocks');
  return { WhatsNewModal: MockWhatsNewModal };
});

vi.mock('../../layouts/MainLayout', async () => {
  const { MockMainLayout } = await import('../utils/componentMocks');
  return { MainLayout: MockMainLayout };
});