import React from 'react';
import { describe, expect, it, vi } from 'vitest';
import { render, screen } from '@testing-library/react';

vi.mock('@/shared/guest/i18n/useTranslation', () => ({
  useTranslation: () => ({ t: (_key: string, fallback?: string) => fallback ?? _key }),
}));

vi.mock('@/hooks/use-appearance', () => ({
  useAppearance: () => ({ resolved: 'dark' }),
}));

vi.mock('@/shared/guest/i18n/LocaleContext', () => ({
  useLocale: () => ({ locale: 'de' }),
}));

vi.mock('@/shared/guest/components/legal-markdown', () => ({
  LegalMarkdown: () => <div>Legal markdown</div>,
}));

vi.mock('@tamagui/scroll-view', () => ({
  ScrollView: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,
}));

vi.mock('@tamagui/stacks', () => ({
  YStack: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,
  XStack: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,
}));

vi.mock('@tamagui/text', () => ({
  SizableText: ({ children }: { children: React.ReactNode }) => <span>{children}</span>,
}));

vi.mock('@tamagui/button', () => ({
  Button: ({ children, ...rest }: { children: React.ReactNode }) => (
    <button type="button" {...rest}>
      {children}
    </button>
  ),
}));

vi.mock('lucide-react', () => ({
  X: () => <span>x</span>,
}));

vi.mock('../components/SettingsContent', () => ({
  default: () => <div>Settings content</div>,
}));

import SettingsSheet from '../components/SettingsSheet';

describe('SettingsSheet', () => {
  it('renders settings content inside the sheet', () => {
    render(<SettingsSheet open onOpenChange={vi.fn()} />);

    expect(screen.getByText('Settings content')).toBeInTheDocument();
  });
});
