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

const logoutMock = vi.fn();

vi.mock('../../auth/context', () => ({
  useAuth: () => ({
    logout: logoutMock,
  }),
}));

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

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

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

vi.mock('tamagui', () => ({
  Spinner: () => <div>spinner</div>,
}));

vi.mock('../theme', () => ({
  useAdminTheme: () => ({
    textStrong: '#111827',
    muted: '#6b7280',
    border: '#e5e7eb',
    surface: '#ffffff',
    shadow: 'rgba(15,23,42,0.12)',
    appBackground: 'linear-gradient(180deg, #fff, #f8fafc)',
  }),
}));

import LogoutPage from '../LogoutPage';

describe('LogoutPage', () => {
  it('renders the logout message', () => {
    render(<LogoutPage />);

    expect(screen.getByText('Abmeldung wird vorbereitet ...')).toBeInTheDocument();
  });
});
