import React from 'react';
import { fireEvent, render, screen } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
import { LocaleProvider } from '../../i18n/LocaleContext';
import { ConsentProvider } from '../../../contexts/consent';
import { SettingsSheet } from '../settings-sheet';

describe('SettingsSheet language section', () => {
  it('does not render active badge or description text', () => {
    render(
      <MemoryRouter>
        <ConsentProvider>
          <LocaleProvider>
            <SettingsSheet />
          </LocaleProvider>
        </ConsentProvider>
      </MemoryRouter>
    );

    fireEvent.click(screen.getByRole('button', { name: 'Einstellungen öffnen' }));

    expect(screen.getByText('Sprache')).toBeInTheDocument();
    expect(screen.queryByText('Wähle deine bevorzugte Sprache für diese Veranstaltung.')).not.toBeInTheDocument();
    expect(screen.queryByText('aktiv')).not.toBeInTheDocument();
  });
});
