import { describe, it, expect } from 'vitest';
import { screen } from '@testing-library/react';
import { renderWithProviders } from '../test/utils';
import SettingsMenuPage from './SettingsMenuPage';
import { SETTINGS_MENU } from '../components/layout/SettingsLayout';

describe('SettingsMenuPage', () => {
  it('lists every settings section', () => {
    renderWithProviders(<SettingsMenuPage />);
    for (const item of SETTINGS_MENU) {
      expect(screen.getByText(item.label)).toBeInTheDocument();
    }
  });

  it('links implemented sections and disables the rest', () => {
    renderWithProviders(<SettingsMenuPage />);
    // implemented → anchor with href
    expect(screen.getByText('خرید اشتراک').closest('a')).toHaveAttribute('href', '/admin/subscription');
    // not implemented → disabled button
    expect(screen.getByText('مدیریت نوبت دهی').closest('button')).toBeDisabled();
  });
});
